Merge remote-tracking branch 'origin/pr/4309'
This commit is contained in:
commit
05a65fdb2f
@ -355,6 +355,17 @@ class TabWidget(QTabWidget):
|
|||||||
if config.val.tabs.tabs_are_windows:
|
if config.val.tabs.tabs_are_windows:
|
||||||
self.window().setWindowIcon(self.window().windowIcon())
|
self.window().setWindowIcon(self.window().windowIcon())
|
||||||
|
|
||||||
|
def setTabIcon(self, idx: int, icon: QIcon):
|
||||||
|
"""Add overrides for setting tab icon sometimes when it is empty."""
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
class TabBar(QTabBar):
|
class TabBar(QTabBar):
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ class TestTabWidget:
|
|||||||
widget.addTab(fake_web_tab(), 'foobar' + str(i))
|
widget.addTab(fake_web_tab(), 'foobar' + str(i))
|
||||||
|
|
||||||
# Set pinned title format longer than unpinned
|
# 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.title.format = "_" * 2
|
||||||
config_stub.val.tabs.pinned.shrink = shrink_pinned
|
config_stub.val.tabs.pinned.shrink = shrink_pinned
|
||||||
if vertical:
|
if vertical:
|
||||||
|
Loading…
Reference in New Issue
Block a user