From 00f67135aee22eb46115fe0ae2192244af364fa4 Mon Sep 17 00:00:00 2001 From: ZDarian Date: Fri, 23 Jan 2015 06:34:01 -0700 Subject: [PATCH] Fixed tabbar visibility update --- qutebrowser/mainwindow/tabwidget.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index 1cdd6a328..48ca5a544 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -97,6 +97,7 @@ class TabBar(QTabBar): config_obj.changed.connect(self.set_colors) QTimer.singleShot(0, self.autohide) config_obj.changed.connect(self.autohide) + config_obj.changed.connect(self.alwayshide) config_obj.changed.connect(self.on_tab_colors_changed) def __repr__(self): @@ -104,14 +105,23 @@ class TabBar(QTabBar): @config.change_filter('tabs', 'hide-auto') def autohide(self): + self.tabhide() + + @config.change_filter('tabs', 'hide-always') + def alwayshide(self): + self.tabhide() + + def tabhide(self): """Auto-hide the tabbar if needed.""" hide_auto = config.get('tabs', 'hide-auto') hide_always = config.get('tabs', 'hide-always') + print('draw') if hide_always or hide_auto and self.count() == 1: self.hide() else: self.show() + def refresh(self): """Properly repaint the tab bar and relayout tabs.""" # This is a horrible hack, but we need to do this so the underlaying Qt