Draw tabbar background correctly again.

This commit is contained in:
Florian Bruhin 2014-08-04 19:30:09 +02:00
parent c9436bbaef
commit 036178147b
2 changed files with 9 additions and 1 deletions

View File

@ -869,7 +869,7 @@ DATA = OrderedDict([
"Background color of selected tabs."),
('tab.bg.bar',
SettingValue(types.QssColor(), '#555555'),
SettingValue(types.QtColor(), '#555555'),
"Background color of the tabbar."),
('tab.indicator.start',

View File

@ -104,6 +104,10 @@ class TabBar(QTabBar):
self.setStyle(TabBarStyle(self.style()))
self.setFont(config.get('fonts', 'tabbar'))
self.vertical = False
self.setAutoFillBackground(True)
p = self.palette()
p.setColor(QPalette.Window, config.get('colors', 'tab.bg.bar'))
self.setPalette(p)
def __repr__(self):
return '<{} with {} tabs>'.format(self.__class__.__name__,
@ -130,6 +134,10 @@ class TabBar(QTabBar):
"""Update attributes when config changed."""
if section == 'fonts' and option == 'tabbar':
self.setFont(config.get('fonts', 'tabbar'))
elif section == 'colors' and option == 'tab.bg.bar':
p = self.palette()
p.setColor(QPalette.Window, config.get('colors', 'tab.bg.bar'))
self.setPalette(p)
def mousePressEvent(self, e):
"""Override mousePressEvent to close tabs if configured."""