fix "unlock tabs" no close button for 'all book'

This commit is contained in:
un-pogaz 2022-10-16 10:10:54 +02:00
parent 3beb835042
commit 2e829adf9f

View File

@ -440,12 +440,15 @@ class VLTabs(QTabBar): # {{{
def unlock_tab(self):
gprefs['vl_tabs_closable'] = True
for idx in range(self.count()):
if not str(self.tabData(idx) or '').strip():
break
self.setTabsClosable(True)
try:
self.tabButton(0, QTabBar.ButtonPosition.RightSide).setVisible(False)
self.tabButton(idx, QTabBar.ButtonPosition.RightSide).setVisible(False)
except AttributeError:
try:
self.tabButton(0, QTabBar.ButtonPosition.LeftSide).setVisible(False)
self.tabButton(idx, QTabBar.ButtonPosition.LeftSide).setVisible(False)
except AttributeError:
# On some OS X machines (using native style) the tab button is
# on the left