mirror of
https://github.com/onionshare/onionshare.git
synced 2025-07-27 08:36:05 -04:00
Show the server status in the tab as an icon
This commit is contained in:
parent
9dc14e8f4e
commit
3052c58d64
2 changed files with 38 additions and 38 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue