diff --git a/src/calibre/gui2/init.py b/src/calibre/gui2/init.py index 87d083db8d..7d824cb909 100644 --- a/src/calibre/gui2/init.py +++ b/src/calibre/gui2/init.py @@ -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 diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index c7189de7e2..ca0fc26927 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -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':