Add show-favicons option
This commit is contained in:
parent
c0933b9e3d
commit
3c4866f3d9
@ -307,6 +307,11 @@ DATA = OrderedDict([
|
||||
('max-tab-width',
|
||||
SettingValue(types.Int(), '200'),
|
||||
"The maximum width of a tab."),
|
||||
|
||||
('show-favicons',
|
||||
SettingValue(types.Bool(), 'true'),
|
||||
"Whether to show favicons in the tab bar."),
|
||||
|
||||
)),
|
||||
|
||||
('webkit', sect.KeyValue(
|
||||
|
@ -461,6 +461,13 @@ class TabbedBrowser(TabWidget):
|
||||
super().on_config_changed(section, option)
|
||||
for tab in self._tabs:
|
||||
tab.on_config_changed(section, option)
|
||||
if (section, option) == ('tabbar', 'show-favicons'):
|
||||
show = config.get('tabbar', 'show-favicons')
|
||||
for i in range(self.count()):
|
||||
if show:
|
||||
self.setTabIcon(i, self.widget(i).icon())
|
||||
else:
|
||||
self.setTabIcon(i, EmptyTabIcon())
|
||||
|
||||
@pyqtSlot()
|
||||
def on_load_started(self, tab):
|
||||
@ -500,6 +507,8 @@ class TabbedBrowser(TabWidget):
|
||||
|
||||
Slot for the iconChanged signal of any tab.
|
||||
"""
|
||||
if not config.get('tabbar', 'show-favicons'):
|
||||
return
|
||||
tab = self.sender()
|
||||
self.setTabIcon(self.indexOf(tab), tab.icon())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user