From 469590d4e8fcdd8fd6b8c512a68c8f18b9f8cee0 Mon Sep 17 00:00:00 2001 From: Rok Mandeljc Date: Mon, 29 Aug 2016 14:05:19 +0200 Subject: [PATCH 1/2] 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. --- qutebrowser/mainwindow/tabwidget.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index dcf289452..baeb7d620 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( @@ -656,6 +657,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) From 74992553953da6ccc87a6a7fafa8a56413ff1460 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 1 Sep 2016 07:29:13 +0200 Subject: [PATCH 2/2] Update docs --- CHANGELOG.asciidoc | 1 + README.asciidoc | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 6b47bb214..ea2aef47d 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -139,6 +139,7 @@ Fixed mode. - `:tab-detach` now fails correctly when there's only one tab open. - Various small issues with the command completion +- The tabbar now displays correctly with the Adwaita Qt theme v0.8.3 (unreleased) ------------------- diff --git a/README.asciidoc b/README.asciidoc index 1e9313469..e50a546c4 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -238,6 +238,7 @@ Contributors, sorted by the number of commits in descending order: * Tim Harder * Thiago Barroso Perrotta * Sorokin Alexei +* Rok Mandeljc * Noah Huesser * Moez Bouhlel * Matthias Lisin