diff --git a/qutebrowser/browser/webview.py b/qutebrowser/browser/webview.py index 4c50a0212..fea278211 100644 --- a/qutebrowser/browser/webview.py +++ b/qutebrowser/browser/webview.py @@ -35,7 +35,7 @@ from qutebrowser.utils import message, log, usertypes, utils, qtutils, objreg from qutebrowser.browser import webpage, hints, webelem -LoadStatus = usertypes.enum('LoadStatus', ['none', 'success', 'error', 'warn', +LoadStatus = usertypes.enum('LoadStatus', ['none', 'success', 'success_https', 'error', 'warn', 'loading']) @@ -423,7 +423,11 @@ class WebView(QWebView): """ ok = not self.page().error_occurred if ok and not self._has_ssl_errors: - self._set_load_status(LoadStatus.success) + if self.cur_url.toDisplayString().startswith('https'): + self._set_load_status(LoadStatus.success_https) + else: + self._set_load_status(LoadStatus.success) + elif ok: self._set_load_status(LoadStatus.warn) else: diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 1517280a8..1d7de5b18 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -872,13 +872,17 @@ def data(readonly=False): SettingValue(typ.QssColor(), '#ff4444'), "Foreground color of the matched text in the completion."), + ('statusbar.fg.https', + SettingValue(typ.QssColor(), 'white'), + "Foreground color of the statusbar(https)."), + ('statusbar.fg', SettingValue(typ.QssColor(), 'white'), - "Foreground color of the statusbar."), + "Foreground color of the statusbar(http)."), ('statusbar.bg', SettingValue(typ.QssColor(), 'black'), - "Foreground color of the statusbar."), + "Background color of the statusbar(http)."), ('statusbar.fg.error', SettingValue(typ.QssColor(), '${statusbar.fg}'), @@ -947,9 +951,14 @@ def data(readonly=False): "Default foreground color of the URL in the statusbar."), ('statusbar.url.fg.success', + SettingValue(typ.QssColor(), 'white'), + "Foreground color of the URL in the statusbar on successful " + "load (http)."), + + ('statusbar.url.fg.success.https', SettingValue(typ.QssColor(), 'lime'), "Foreground color of the URL in the statusbar on successful " - "load."), + "load (https)."), ('statusbar.url.fg.error', SettingValue(typ.QssColor(), 'orange'), diff --git a/qutebrowser/mainwindow/statusbar/url.py b/qutebrowser/mainwindow/statusbar/url.py index d18816b00..dde4533d9 100644 --- a/qutebrowser/mainwindow/statusbar/url.py +++ b/qutebrowser/mainwindow/statusbar/url.py @@ -28,7 +28,7 @@ from qutebrowser.utils import usertypes # Note this has entries for success/error/warn from widgets.webview:LoadStatus -UrlType = usertypes.enum('UrlType', ['success', 'error', 'warn', 'hover', +UrlType = usertypes.enum('UrlType', ['success', 'success_https', ' error', 'warn', 'hover', 'normal']) @@ -61,6 +61,10 @@ class UrlText(textbase.TextBase): {{ color['statusbar.url.fg.success'] }} } + QLabel#UrlText[urltype="success_https"] { + {{ color['statusbar.url.fg.success.https'] }} + } + QLabel#UrlText[urltype="error"] { {{ color['statusbar.url.fg.error'] }} } @@ -116,8 +120,8 @@ class UrlText(textbase.TextBase): status_str: The LoadStatus as string. """ status = webview.LoadStatus[status_str] - if status in (webview.LoadStatus.success, webview.LoadStatus.error, - webview.LoadStatus.warn): + if status in (webview.LoadStatus.success, webview.LoadStatus.success_https, + webview.LoadStatus.error, webview.LoadStatus.warn): self._normal_url_type = UrlType[status_str] else: self._normal_url_type = UrlType.normal