mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Prevent Directories tab from closing on MacOS
* The close button on custom tabs cannot be hidden on MacOS for some reason. * Prevent the directories tab from closing if the close button was clicked by mistake
This commit is contained in:
parent
0104d8922c
commit
866bf996cf
@ -344,6 +344,11 @@ class TabBarWindow(TabWindow):
|
||||
@pyqtSlot(int)
|
||||
def onTabCloseRequested(self, index):
|
||||
current_widget = self.getWidgetAtIndex(index)
|
||||
if isinstance(current_widget, DirectoriesDialog):
|
||||
# On MacOS, the tab has a close button even though we explicitely
|
||||
# set it to None in order to hide it. This should prevent
|
||||
# the "Directories" tab from closing by mistake.
|
||||
return
|
||||
current_widget.close()
|
||||
self.stackedWidget.removeWidget(current_widget)
|
||||
# In this case the signal will take care of the tab itself after removing the widget
|
||||
|
Loading…
x
Reference in New Issue
Block a user