mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2058640 [Virtual library tab glitch](https://bugs.launchpad.net/calibre/+bug/2058640)
This commit is contained in:
parent
5313a21464
commit
75004afdb0
@ -358,10 +358,15 @@ class VLTabs(QTabBar): # {{{
|
|||||||
def lock_tab(self):
|
def lock_tab(self):
|
||||||
gprefs['vl_tabs_closable'] = False
|
gprefs['vl_tabs_closable'] = False
|
||||||
self.setTabsClosable(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):
|
def unlock_tab(self):
|
||||||
gprefs['vl_tabs_closable'] = True
|
gprefs['vl_tabs_closable'] = True
|
||||||
self.setTabsClosable(True)
|
self.setTabsClosable(True)
|
||||||
|
# ensure no button on the All books tab since it is not closeable
|
||||||
for idx in range(self.count()):
|
for idx in range(self.count()):
|
||||||
if not self.tabData(idx):
|
if not self.tabData(idx):
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user