From 75004afdb0a097af59a3fff9430c0b438ff3fe6c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 1 Apr 2024 14:34:31 +0530 Subject: [PATCH] Fix #2058640 [Virtual library tab glitch](https://bugs.launchpad.net/calibre/+bug/2058640) --- src/calibre/gui2/init.py | 5 +++++ 1 file changed, 5 insertions(+) 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: