Don't force minimum tab size.

This commit is contained in:
Florian Bruhin 2014-07-11 16:54:54 +02:00
parent f1fac86a6a
commit c369bde6ad

View File

@ -151,6 +151,25 @@ class TabBar(QTabBar):
if config.get('tabbar', 'close-on-right-click'): if config.get('tabbar', 'close-on-right-click'):
self.tab_rightclicked.emit(idx) 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): def tabSizeHint(self, index):
"""Override tabSizeHint so all tabs are the same size. """Override tabSizeHint so all tabs are the same size.