mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
fix "unlock tabs" no close button for 'all book'
This commit is contained in:
parent
3beb835042
commit
2e829adf9f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user