diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index bd040a7a8..b0e757957 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -226,6 +226,7 @@ |<>|Background color of selected odd tabs. |<>|Foreground color of selected even tabs. |<>|Background color of selected even tabs. +|<>|Background color of the tab bar. |<>|Color gradient start for the tab indicator. |<>|Color gradient end for the tab indicator. |<>|Color for the tab indicator on errors.. @@ -1833,6 +1834,12 @@ Background color of selected even tabs. Default: +pass:[${tabs.bg.selected.odd}]+ +[[colors-tabs.bg.bar]] +=== tabs.bg.bar +Background color of the tab bar. + +Default: +pass:[#555555]+ + [[colors-tabs.indicator.start]] === tabs.indicator.start Color gradient start for the tab indicator. diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 1d537d44a..9dbcaf4cf 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -333,6 +333,7 @@ class ConfigManager(QObject): ('colors', 'tab.bg.even'): 'tabs.bg.even', ('colors', 'tab.bg.selected'): 'tabs.bg.selected.odd', ('colors', 'tabs.bg.selected'): 'tabs.bg.selected.odd', + ('colors', 'tab.bg.bar'): 'tabs.bg.bar', ('colors', 'tab.indicator.start'): 'tabs.indicator.start', ('colors', 'tab.indicator.stop'): 'tabs.indicator.stop', ('colors', 'tab.indicator.error'): 'tabs.indicator.error', @@ -348,8 +349,6 @@ class ConfigManager(QObject): ('tabs', 'indicator-space'), ('tabs', 'hide-auto'), ('tabs', 'hide-always'), - ('colors', 'tab.bg.bar'), - ('colors', 'tabs.bg.bar'), ] CHANGED_OPTIONS = { ('content', 'cookies-accept'): diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 1085866de..1517280a8 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -997,6 +997,10 @@ def data(readonly=False): SettingValue(typ.QtColor(), '${tabs.bg.selected.odd}'), "Background color of selected even tabs."), + ('tabs.bg.bar', + SettingValue(typ.QtColor(), '#555555'), + "Background color of the tab bar."), + ('tabs.indicator.start', SettingValue(typ.QtColor(), '#0000aa'), "Color gradient start for the tab indicator."), diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index 853b9004a..46a8e48d6 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -235,6 +235,8 @@ class TabBar(QTabBar): 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.on_show_switching_delay_changed) @@ -318,6 +320,13 @@ class TabBar(QTabBar): size = self.fontMetrics().height() - 2 self.setIconSize(QSize(size, size)) + @config.change_filter('colors', 'tabs.bg.bar') + def set_colors(self): + """Set the tab bar colors.""" + p = self.palette() + p.setColor(QPalette.Window, config.get('colors', 'tabs.bg.bar')) + self.setPalette(p) + @pyqtSlot(str, str) def on_tab_colors_changed(self, section, option): """Set the tab colors."""