Fix pinned tabs being too small in extreme situations
This commit is contained in:
parent
63d23ca9df
commit
46533c3367
@ -477,7 +477,7 @@ class TabBar(QTabBar):
|
|||||||
Args:
|
Args:
|
||||||
index: The index of the tab to get a size hint for.
|
index: The index of the tab to get a size hint for.
|
||||||
ellipsis: Whether to use ellipsis to calculate width
|
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:
|
Return:
|
||||||
A QSize of the smallest tab size we can make.
|
A QSize of the smallest tab size we can make.
|
||||||
"""
|
"""
|
||||||
@ -489,6 +489,11 @@ class TabBar(QTabBar):
|
|||||||
else:
|
else:
|
||||||
icon_width = min(icon.actualSize(self.iconSize()).width(),
|
icon_width = min(icon.actualSize(self.iconSize()).width(),
|
||||||
self.iconSize().width()) + icon_padding
|
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),
|
return self._minimum_tab_size_hint_helper(self.tabText(index),
|
||||||
icon_width,
|
icon_width,
|
||||||
ellipsis)
|
ellipsis)
|
||||||
|
Loading…
Reference in New Issue
Block a user