Draw tabbar background correctly again.
This commit is contained in:
parent
c9436bbaef
commit
036178147b
@ -869,7 +869,7 @@ DATA = OrderedDict([
|
|||||||
"Background color of selected tabs."),
|
"Background color of selected tabs."),
|
||||||
|
|
||||||
('tab.bg.bar',
|
('tab.bg.bar',
|
||||||
SettingValue(types.QssColor(), '#555555'),
|
SettingValue(types.QtColor(), '#555555'),
|
||||||
"Background color of the tabbar."),
|
"Background color of the tabbar."),
|
||||||
|
|
||||||
('tab.indicator.start',
|
('tab.indicator.start',
|
||||||
|
@ -104,6 +104,10 @@ class TabBar(QTabBar):
|
|||||||
self.setStyle(TabBarStyle(self.style()))
|
self.setStyle(TabBarStyle(self.style()))
|
||||||
self.setFont(config.get('fonts', 'tabbar'))
|
self.setFont(config.get('fonts', 'tabbar'))
|
||||||
self.vertical = False
|
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):
|
def __repr__(self):
|
||||||
return '<{} with {} tabs>'.format(self.__class__.__name__,
|
return '<{} with {} tabs>'.format(self.__class__.__name__,
|
||||||
@ -130,6 +134,10 @@ class TabBar(QTabBar):
|
|||||||
"""Update attributes when config changed."""
|
"""Update attributes when config changed."""
|
||||||
if section == 'fonts' and option == 'tabbar':
|
if section == 'fonts' and option == 'tabbar':
|
||||||
self.setFont(config.get('fonts', '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):
|
def mousePressEvent(self, e):
|
||||||
"""Override mousePressEvent to close tabs if configured."""
|
"""Override mousePressEvent to close tabs if configured."""
|
||||||
|
Loading…
Reference in New Issue
Block a user