From 9cc688ea2b71e12d068f608617a128d3e7548550 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 16 Jun 2017 23:00:16 +0200 Subject: [PATCH] Fix initial tab sizing with vertical tabbar --- qutebrowser/mainwindow/tabbedbrowser.py | 8 ++++++-- tests/end2end/features/javascript.feature | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 22ad7dd6b..b01c9d282 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -433,8 +433,12 @@ class TabbedBrowser(tabwidget.TabWidget): # Make sure the background tab has the correct initial size. # With a foreground tab, it's going to be resized correctly by the # layout anyways. - tab_size = QSize(self.width(), - self.height() - self.tabBar().height()) + if self.tabBar().vertical: + tab_size = QSize(self.width() - self.tabBar().width(), + self.height()) + else: + tab_size = QSize(self.width(), + self.height() - self.tabBar().height()) tab.resize(tab_size) self.tab_index_changed.emit(self.currentIndex(), self.count()) else: diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index efdd692ac..c6c7acc15 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -116,3 +116,12 @@ Feature: Javascript stuff And I wait for "[*/data/javascript/windowsize.html:*] loaded" in the log And I run :tab-next Then the window sizes should be the same + + Scenario: Checking visible/invisible window size with vertical tabbar + When I run :tab-only + And I set general -> log-javascript-console to info + And I set tabs -> position to left + And I open data/javascript/windowsize.html in a new background tab + And I wait for "[*/data/javascript/windowsize.html:*] loaded" in the log + And I run :tab-next + Then the window sizes should be the same