From c369bde6ad672cfc6f2b3dbc478be1eabe1f4158 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 11 Jul 2014 16:54:54 +0200 Subject: [PATCH] Don't force minimum tab size. --- qutebrowser/widgets/tabwidget.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qutebrowser/widgets/tabwidget.py b/qutebrowser/widgets/tabwidget.py index 06fb876f2..49418143b 100644 --- a/qutebrowser/widgets/tabwidget.py +++ b/qutebrowser/widgets/tabwidget.py @@ -151,6 +151,25 @@ class TabBar(QTabBar): if config.get('tabbar', 'close-on-right-click'): self.tab_rightclicked.emit(idx) + def minimumTabSizeHint(self, index): + """Override minimumTabSizeHint because we want no hard minimum. + + There are two problems with having a hard minimum tab size: + - When expanding is True, the window will expand without stopping + on some window managers. + - We don't want the main window to get bigger with many tabs. If + nothing else helps, we *do* want the tabs to get smaller instead + of enforcing a minimum window size. + + Args: + index: The index of the tab to get a sizehint for. + + Return: + A QSize. + """ + height = super().tabSizeHint(index).height() + return QSize(1, height) + def tabSizeHint(self, index): """Override tabSizeHint so all tabs are the same size.