diff --git a/src/calibre/gui2/init.py b/src/calibre/gui2/init.py index ee3b4e7758..87d083db8d 100644 --- a/src/calibre/gui2/init.py +++ b/src/calibre/gui2/init.py @@ -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: