diff --git a/desktop/README.md b/desktop/README.md index 83f0843d..4ccc22fa 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -41,7 +41,7 @@ pip install briefcase Run OnionShare from the source tree like this: ``` -briefcase dev +briefcase dev -d ``` ## Running tests diff --git a/desktop/pyproject.toml b/desktop/pyproject.toml index 3675de73..d08a1a63 100644 --- a/desktop/pyproject.toml +++ b/desktop/pyproject.toml @@ -22,7 +22,7 @@ requires = [ "psutil", "pycryptodome", "PySocks", - "pyside2", + "pyside2==5.15.1", "qrcode", "requests", "stem", diff --git a/desktop/src/onionshare/resources/images/close_tab.png b/desktop/src/onionshare/resources/images/close_tab.png deleted file mode 100644 index a7984a6d..00000000 Binary files a/desktop/src/onionshare/resources/images/close_tab.png and /dev/null differ diff --git a/desktop/src/onionshare/tab/tab.py b/desktop/src/onionshare/tab/tab.py index a511557b..6a7624b9 100644 --- a/desktop/src/onionshare/tab/tab.py +++ b/desktop/src/onionshare/tab/tab.py @@ -107,6 +107,10 @@ class Tab(QtWidgets.QWidget): # Start the OnionShare app self.app = OnionShare(common, self.common.gui.onion, self.common.gui.local_only) + # An invisible widget, used for hiding the persistent tab icon + self.invisible_widget = QtWidgets.QWidget() + self.invisible_widget.setFixedSize(0, 0) + # Onionshare logo self.image_label = QtWidgets.QLabel() self.image_label.setPixmap( diff --git a/desktop/src/onionshare/tab_widget.py b/desktop/src/onionshare/tab_widget.py index 452b56bb..2e85febf 100644 --- a/desktop/src/onionshare/tab_widget.py +++ b/desktop/src/onionshare/tab_widget.py @@ -144,6 +144,7 @@ class TabWidget(QtWidgets.QTabWidget): self.add_tab(mode_settings) def add_tab(self, mode_settings=None): + self.common.log("TabWidget", "add_tab", f"mode_settings: {mode_settings}") tab = Tab(self.common, self.current_tab_id, self.system_tray, self.status_bar) tab.change_title.connect(self.change_title) tab.change_icon.connect(self.change_icon) @@ -155,19 +156,6 @@ class TabWidget(QtWidgets.QTabWidget): index = self.addTab(tab, strings._("gui_new_tab")) self.setCurrentIndex(index) - # Create a close button - def close_tab(): - self.tabBar().tabCloseRequested.emit(self.indexOf(tab)) - - close_button = QtWidgets.QPushButton() - close_button.setFlat(True) - close_button.setFixedWidth(40) - close_button.setIcon( - QtGui.QIcon(GuiCommon.get_resource_path("images/close_tab.png")) - ) - close_button.clicked.connect(close_tab) - self.tabBar().setTabButton(index, QtWidgets.QTabBar.RightSide, close_button) - tab.init(mode_settings) # If it's persistent, set the persistent image in the tab self.change_persistent(tab.tab_id, tab.settings.get("persistent", "enabled")) @@ -184,6 +172,11 @@ class TabWidget(QtWidgets.QTabWidget): self.setTabIcon(index, QtGui.QIcon(GuiCommon.get_resource_path(icon_path))) def change_persistent(self, tab_id, is_persistent): + self.common.log( + "TabWidget", + "change_persistent", + f"tab_id: {tab_id}, is_persistent: {is_persistent}", + ) index = self.indexOf(self.tabs[tab_id]) if is_persistent: self.tabBar().setTabButton( @@ -192,10 +185,8 @@ class TabWidget(QtWidgets.QTabWidget): self.tabs[tab_id].persistent_image_label, ) else: - invisible_widget = QtWidgets.QWidget() - invisible_widget.setFixedSize(0, 0) self.tabBar().setTabButton( - index, QtWidgets.QTabBar.LeftSide, invisible_widget + index, QtWidgets.QTabBar.LeftSide, self.tabs[tab_id].invisible_widget ) self.save_persistent_tabs()