Show the server status in the tab as an icon

This commit is contained in:
Micah Lee 2019-10-27 16:32:12 -07:00
parent 9dc14e8f4e
commit 3052c58d64
2 changed files with 38 additions and 38 deletions

View file

@ -89,6 +89,7 @@ class TabWidget(QtWidgets.QTabWidget):
# Create the tab
tab = Tab(self.common, self.tab_id, self.system_tray, self.status_bar)
tab.change_title.connect(self.change_title)
tab.change_icon.connect(self.change_icon)
self.tabs[self.tab_id] = tab
self.tab_id += 1
@ -105,6 +106,10 @@ class TabWidget(QtWidgets.QTabWidget):
index, QtWidgets.QTabBar.LeftSide, self.tabs[tab_id].persistence_button
)
def change_icon(self, tab_id, icon_path):
index = self.indexOf(self.tabs[tab_id])
self.setTabIcon(index, QtGui.QIcon(self.common.get_resource_path(icon_path)))
def close_tab(self, index):
self.common.log("TabWidget", "close_tab", f"{index}")
tab = self.widget(index)