mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'fix_unlock_tab' of https://github.com/un-pogaz/calibre
This commit is contained in:
commit
de01331f98
@ -440,12 +440,15 @@ class VLTabs(QTabBar): # {{{
|
|||||||
|
|
||||||
def unlock_tab(self):
|
def unlock_tab(self):
|
||||||
gprefs['vl_tabs_closable'] = True
|
gprefs['vl_tabs_closable'] = True
|
||||||
|
for idx in range(self.count()):
|
||||||
|
if not str(self.tabData(idx) or '').strip():
|
||||||
|
break
|
||||||
self.setTabsClosable(True)
|
self.setTabsClosable(True)
|
||||||
try:
|
try:
|
||||||
self.tabButton(0, QTabBar.ButtonPosition.RightSide).setVisible(False)
|
self.tabButton(idx, QTabBar.ButtonPosition.RightSide).setVisible(False)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
try:
|
try:
|
||||||
self.tabButton(0, QTabBar.ButtonPosition.LeftSide).setVisible(False)
|
self.tabButton(idx, QTabBar.ButtonPosition.LeftSide).setVisible(False)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# On some OS X machines (using native style) the tab button is
|
# On some OS X machines (using native style) the tab button is
|
||||||
# on the left
|
# on the left
|
||||||
|
Loading…
x
Reference in New Issue
Block a user