mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2073441 [[Enhancement] Hide VL tabs while in Device view](https://bugs.launchpad.net/calibre/+bug/2073441)
This commit is contained in:
parent
1c26a6ce17
commit
430cf0f5bc
@ -343,7 +343,8 @@ class VLTabs(QTabBar): # {{{
|
||||
self.setCurrentIndex(idx)
|
||||
|
||||
def update_visibility(self):
|
||||
self.setVisible(gprefs['show_vl_tabs'] and self.count() > 1)
|
||||
cv = self.gui.current_view()
|
||||
self.setVisible(gprefs['show_vl_tabs'] and self.count() > 1 and (cv is self.gui.library_view or cv is None))
|
||||
|
||||
def enable_bar(self):
|
||||
gprefs['show_vl_tabs'] = True
|
||||
|
@ -916,7 +916,10 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
|
||||
def current_view(self):
|
||||
'''Convenience method that returns the currently visible view '''
|
||||
idx = self.stack.currentIndex()
|
||||
try:
|
||||
idx = self.stack.currentIndex()
|
||||
except AttributeError:
|
||||
return None # happens during startup
|
||||
if idx == 0:
|
||||
return self.library_view
|
||||
if idx == 1:
|
||||
@ -1038,6 +1041,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
self.book_details.reset_info()
|
||||
self.layout_container.tag_browser_button.setEnabled(location == 'library')
|
||||
self.layout_container.cover_browser_button.setEnabled(location == 'library')
|
||||
self.vl_tabs.update_visibility()
|
||||
for action in self.iactions.values():
|
||||
action.location_selected(location)
|
||||
if location == 'library':
|
||||
|
Loading…
x
Reference in New Issue
Block a user