Revert "Remove colors -> tabs.bg.bar setting."

This reverts commit 801d2ae8e6.

This is still useful/needed for vertical tab bars.
This commit is contained in:
Florian Bruhin 2015-10-04 17:49:43 +02:00
parent f607659ece
commit 12a11a5931
4 changed files with 21 additions and 2 deletions

View File

@ -226,6 +226,7 @@
|<<colors-tabs.bg.selected.odd,tabs.bg.selected.odd>>|Background color of selected odd tabs.
|<<colors-tabs.fg.selected.even,tabs.fg.selected.even>>|Foreground color of selected even tabs.
|<<colors-tabs.bg.selected.even,tabs.bg.selected.even>>|Background color of selected even tabs.
|<<colors-tabs.bg.bar,tabs.bg.bar>>|Background color of the tab bar.
|<<colors-tabs.indicator.start,tabs.indicator.start>>|Color gradient start for the tab indicator.
|<<colors-tabs.indicator.stop,tabs.indicator.stop>>|Color gradient end for the tab indicator.
|<<colors-tabs.indicator.error,tabs.indicator.error>>|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.

View File

@ -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'):

View File

@ -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."),

View File

@ -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."""