Apply tabs.min_width to all tabs when tabs are unshrunk

This commit is contained in:
Jay Kamat 2018-03-09 12:57:07 -05:00
parent 1672995639
commit 996561b50e
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
2 changed files with 8 additions and 3 deletions

View File

@ -1411,11 +1411,14 @@ tabs.min_width:
type: type:
name: Int name: Int
minval: -1 minval: -1
maxval: maxint
desc: >- desc: >-
Minimum width (in pixels) of tabs (-1 to use text contents for min width). Minimum width (in pixels) of tabs (-1 to use min text contents size for min width).
This setting only applies when tabs are horizontal. This setting only applies when tabs are horizontal.
This setting does not apply to pinned tabs, unless `tabs.pinned.shrink` is False.
tabs.width.indicator: tabs.width.indicator:
renamed: tabs.indicator.width renamed: tabs.indicator.width

View File

@ -359,7 +359,8 @@ class TabBar(QTabBar):
if option in ["tabs.indicator.padding", if option in ["tabs.indicator.padding",
"tabs.padding", "tabs.padding",
"tabs.indicator.width", "tabs.indicator.width",
"tabs.min_width"]: "tabs.min_width",
"tabs.pinned.shrink"]:
self._minimum_tab_size_hint_helper.cache_clear() self._minimum_tab_size_hint_helper.cache_clear()
def _on_show_switching_delay_changed(self): def _on_show_switching_delay_changed(self):
@ -529,7 +530,8 @@ class TabBar(QTabBar):
width = (text_width + icon_width + width = (text_width + icon_width +
padding_h + indicator_width) padding_h + indicator_width)
min_width = config.val.tabs.min_width min_width = config.val.tabs.min_width
if not pinned and not self.vertical and min_width > 0: if (not self.vertical and min_width > 0 and
not pinned or not config.val.tabs.pinned.shrink):
width = max(min_width, width) width = max(min_width, width)
return QSize(width, height) return QSize(width, height)