mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Fix #2104325 [Private bug](https://bugs.launchpad.net/calibre/+bug/2104325)
This commit is contained in:
parent
a65b3833c9
commit
47d18ccfec
@ -314,8 +314,8 @@ class VLTabs(QTabBar): # {{{
|
|||||||
QTabBar.__init__(self, parent)
|
QTabBar.__init__(self, parent)
|
||||||
self.setDocumentMode(True)
|
self.setDocumentMode(True)
|
||||||
self.setDrawBase(False)
|
self.setDrawBase(False)
|
||||||
self.setMovable(True)
|
|
||||||
self.setTabsClosable(gprefs['vl_tabs_closable'])
|
self.setTabsClosable(gprefs['vl_tabs_closable'])
|
||||||
|
self.setMovable(self.tabsClosable())
|
||||||
self.gui = parent
|
self.gui = parent
|
||||||
self.ignore_tab_changed = False
|
self.ignore_tab_changed = False
|
||||||
self.currentChanged.connect(self.tab_changed)
|
self.currentChanged.connect(self.tab_changed)
|
||||||
@ -359,6 +359,7 @@ 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)
|
||||||
|
self.setMovable(False)
|
||||||
# Workaround for Qt bug where it doesn't recalculate the tab size after locking
|
# Workaround for Qt bug where it doesn't recalculate the tab size after locking
|
||||||
for idx in range(self.count()):
|
for idx in range(self.count()):
|
||||||
self.setTabButton(idx, QTabBar.ButtonPosition.RightSide, None)
|
self.setTabButton(idx, QTabBar.ButtonPosition.RightSide, None)
|
||||||
@ -367,6 +368,7 @@ class VLTabs(QTabBar): # {{{
|
|||||||
def unlock_tab(self):
|
def unlock_tab(self):
|
||||||
gprefs['vl_tabs_closable'] = True
|
gprefs['vl_tabs_closable'] = True
|
||||||
self.setTabsClosable(True)
|
self.setTabsClosable(True)
|
||||||
|
self.setMovable(True)
|
||||||
# ensure no button on the All books tab since it is not closeable
|
# 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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user