Implement changing of tab title when privacy mode is enabled

This commit is contained in:
Clayton Craft 2017-06-05 16:49:11 -07:00
parent a45de9cef2
commit 49b8737f79
2 changed files with 4 additions and 2 deletions

View File

@ -377,7 +377,7 @@ def data(readonly=False):
SettingValue(typ.FormatString(fields=['perc', 'perc_raw', 'title',
'title_sep', 'id',
'scroll_pos', 'host',
'backend']),
'backend', 'private']),
'{perc}{title}{title_sep}qutebrowser'),
"The format to use for the window title. The following "
"placeholders are defined:\n\n"
@ -389,7 +389,8 @@ def data(readonly=False):
"* `{id}`: The internal window ID of this window.\n"
"* `{scroll_pos}`: The page scroll position.\n"
"* `{host}`: The host of the current web page.\n"
"* `{backend}`: Either 'webkit' or 'webengine'"),
"* `{backend}`: Either 'webkit' or 'webengine'"
"* `{private}` : Indicates when private mode is enabled.\n"),
('modal-js-dialog',
SettingValue(typ.Bool(), 'false'),

View File

@ -164,6 +164,7 @@ class TabWidget(QTabWidget):
fields['title_sep'] = ' - ' if page_title else ''
fields['perc_raw'] = tab.progress()
fields['backend'] = objects.backend.name
fields['private'] = ' [Private Mode] ' if tab.private else ''
if tab.load_status() == usertypes.LoadStatus.loading:
fields['perc'] = '[{}%] '.format(tab.progress())