Don't apply default icon to unshrunk and vertical tabs

The rationale is that this is only useful to give pinned tabs space
when shrunk in a horizontal tabbar.
This commit is contained in:
Jay Kamat 2018-10-12 20:53:07 -07:00
parent cf5168c849
commit 6a6b56bbf4
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5
2 changed files with 3 additions and 1 deletions

View File

@ -355,6 +355,8 @@ class TabWidget(QTabWidget):
tab = self.widget(idx)
if (icon.isNull() and
config.cache['tabs.favicons.show'] != 'never' and
config.cache['tabs.pinned.shrink'] and
not self.tabBar().vertical and
tab is not None and tab.data.pinned):
icon = self.style().standardIcon(QStyle.SP_FileIcon)
super().setTabIcon(idx, icon)

View File

@ -84,7 +84,7 @@ class TestTabWidget:
widget.addTab(fake_web_tab(), 'foobar' + str(i))
# Set pinned title format longer than unpinned
config_stub.val.tabs.title.format_pinned = "_" * 20
config_stub.val.tabs.title.format_pinned = "_" * 10
config_stub.val.tabs.title.format = "_" * 2
config_stub.val.tabs.pinned.shrink = shrink_pinned
if vertical: