Fix pinned tabs being too small in extreme situations

This commit is contained in:
Jay Kamat 2018-03-09 02:02:31 -05:00
parent 63d23ca9df
commit 46533c3367
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -477,7 +477,7 @@ class TabBar(QTabBar):
Args:
index: The index of the tab to get a size hint for.
ellipsis: Whether to use ellipsis to calculate width
instead of the tab's text.
instead of the tab's text. Forced to true for pinned tabs.
Return:
A QSize of the smallest tab size we can make.
"""
@ -489,6 +489,11 @@ class TabBar(QTabBar):
else:
icon_width = min(icon.actualSize(self.iconSize()).width(),
self.iconSize().width()) + icon_padding
pinned = self._tab_pinned(index)
if pinned:
# Never consider ellipsis an option for pinned tabs
ellipsis = False
return self._minimum_tab_size_hint_helper(self.tabText(index),
icon_width,
ellipsis)