diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index f38192c85..75fd1b6ad 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -485,7 +485,8 @@ def data(readonly=False): ('show-switching-delay', SettingValue(typ.Int(), '800'), - "Time to show the tab bar before hiding it when tabs->show is set to 'switching'."), + "Time to show the tab bar before hiding it when tabs->show is " + "set to 'switching'."), ('wrap', SettingValue(typ.Bool(), 'true'), diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 8541b81c4..e6e2ab0af 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -1567,10 +1567,14 @@ class UserAgent(BaseType): ] return out + class TabBarShow(BaseType): + """When to show the tab bar.""" valid_values = ValidValues(('always', "Always show the tab bar."), ('never', "Always hide the tab bar."), - ('multiple', "Hide the tab bar if only one tab is open."), - ('switching', "Show the tab bar when switching tabs.")) + ('multiple', "Hide the tab bar if only one tab " + "is open."), + ('switching', "Show the tab bar when switching " + "tabs.")) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index 18efe5df5..ea1426add 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -223,14 +223,15 @@ class TabBar(QTabBar): self.vertical = False self._auto_hide_timer = QTimer() self._auto_hide_timer.setSingleShot(True) - self._auto_hide_timer.setInterval(config.get('tabs', 'show-switching-delay')) + self._auto_hide_timer.setInterval( + config.get('tabs', 'show-switching-delay')) self._auto_hide_timer.timeout.connect(self._tabhide) self.setAutoFillBackground(True) self.set_colors() config_obj.changed.connect(self.set_colors) QTimer.singleShot(0, self._tabhide) config_obj.changed.connect(self.on_tab_colors_changed) - config_obj.changed.connect(self.show_switching_delay) + config_obj.changed.connect(self.on_show_switching_delay_changed) config_obj.changed.connect(self.tabs_show) def __repr__(self): @@ -242,9 +243,10 @@ class TabBar(QTabBar): self._tabhide() @config.change_filter('tabs', 'show-switching-delay') - def show_switching_delay(self): + def on_show_switching_delay_changed(self): """Set timer interval when tabs->show-switching-delay got changed.""" - self._auto_hide_timer.setInterval(config.get('tabs', 'show-switching-delay')) + self._auto_hide_timer.setInterval( + config.get('tabs', 'show-switching-delay')) def on_change(self): """Show tab bar when current tab got changed."""