Clean up previous PR

This commit is contained in:
Kovid Goyal 2022-10-16 14:04:11 +05:30
parent de01331f98
commit 6c9551e570
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -440,19 +440,19 @@ class VLTabs(QTabBar): # {{{
def unlock_tab(self): def unlock_tab(self):
gprefs['vl_tabs_closable'] = True gprefs['vl_tabs_closable'] = True
for idx in range(self.count()):
if not str(self.tabData(idx) or '').strip():
break
self.setTabsClosable(True) self.setTabsClosable(True)
try: for idx in range(self.count()):
self.tabButton(idx, QTabBar.ButtonPosition.RightSide).setVisible(False) if not self.tabData(idx):
except AttributeError: try:
try: self.tabButton(idx, QTabBar.ButtonPosition.RightSide).setVisible(False)
self.tabButton(idx, QTabBar.ButtonPosition.LeftSide).setVisible(False) except AttributeError:
except AttributeError: try:
# On some OS X machines (using native style) the tab button is self.tabButton(idx, QTabBar.ButtonPosition.LeftSide).setVisible(False)
# on the left except AttributeError:
pass # On some OS X machines (using native style) the tab button is
# on the left
pass
break
def tab_changed(self, idx): def tab_changed(self, idx):
if self.ignore_tab_changed: if self.ignore_tab_changed: