summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRok Mandeljc <rok.mandeljc@gmail.com>2016-08-29 14:05:19 +0200
committerFlorian Bruhin <git@the-compiler.org>2016-11-05 22:20:10 +0100
commit6cd159246cc7885545680173ae75284db28f10a5 (patch)
treed6905b3f6b59e036ee30a303bc4b9b8b1abd64ab
parent552198ac31f93a801eb8bcc6eb4445bb2074f0ab (diff)
downloadqutebrowser-6cd159246cc7885545680173ae75284db28f10a5.tar.gz
qutebrowser-6cd159246cc7885545680173ae75284db28f10a5.zip
TabWidget: a possible fix for #1693 - grey area under custom tabbar
Attempt to fix the issue #1693 by: - setting the TabBarStyle to TabWidget in addition to TabBar - chain up SE_TabWidgetTabBar requests in TabBarStyle.subElementRect to the super() rather than self._style, in order to avoid getting adwaita-specific rect sizes instead of default ones that are also used in rendering.
-rw-r--r--qutebrowser/mainwindow/tabwidget.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py
index 537ff5ea4..567b01c8f 100644
--- a/qutebrowser/mainwindow/tabwidget.py
+++ b/qutebrowser/mainwindow/tabwidget.py
@@ -50,6 +50,7 @@ class TabWidget(QTabWidget):
def __init__(self, win_id, parent=None):
super().__init__(parent)
bar = TabBar(win_id)
+ self.setStyle(TabBarStyle(self.style()))
self.setTabBar(bar)
bar.tabCloseRequested.connect(self.tabCloseRequested)
bar.tabMoved.connect(functools.partial(
@@ -652,6 +653,12 @@ class TabBarStyle(QCommonStyle):
if sr == QStyle.SE_TabBarTabText:
layouts = self._tab_layout(opt)
return layouts.text
+ elif sr == QStyle.SE_TabWidgetTabBar:
+ # Need to use super() because we also use super() to render
+ # element in drawControl(); otherwise, we may get bit by
+ # style differences...
+ rct = super().subElementRect(sr, opt, widget)
+ return rct
else:
return self._style.subElementRect(sr, opt, widget)