This commit is contained in:
Kovid Goyal 2024-04-01 14:34:31 +05:30
parent 5313a21464
commit 75004afdb0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -358,10 +358,15 @@ class VLTabs(QTabBar): # {{{
def lock_tab(self):
gprefs['vl_tabs_closable'] = False
self.setTabsClosable(False)
# Workaround for Qt bug where it doesnt recalculate the tab size after locking
for idx in range(self.count()):
self.setTabButton(idx, QTabBar.ButtonPosition.RightSide, None)
self.setTabButton(idx, QTabBar.ButtonPosition.LeftSide, None)
def unlock_tab(self):
gprefs['vl_tabs_closable'] = True
self.setTabsClosable(True)
# ensure no button on the All books tab since it is not closeable
for idx in range(self.count()):
if not self.tabData(idx):
try: