diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index ee59e0133..f4e5c29a0 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -33,6 +33,8 @@ Added the URL should be affected by `:navigate increment/decrement`. - New `--target` argument to specify how URLs should be opened in an existing instance. +- New setting `statusbar.url.fg.success.https` to set the foreground color for + the URL when a page was loaded via HTTPS. Changed ~~~~~~~ diff --git a/README.asciidoc b/README.asciidoc index 59363c9c5..4385ad1fb 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -155,6 +155,7 @@ Contributors, sorted by the number of commits in descending order: * Zach-Button * rikn00 * Patric Schmitz +* Nathan Isom * Martin Zimmermann * Error 800 * Brian Jackson diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index b0e757957..2a8502bdd 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -197,7 +197,7 @@ |<>|Bottom border color of the selected completion item. |<>|Foreground color of the matched text in the completion. |<>|Foreground color of the statusbar. -|<>|Foreground color of the statusbar. +|<>|Background color of the statusbar. |<>|Foreground color of the statusbar if there was an error. |<>|Background color of the statusbar if there was an error. |<>|Foreground color of the statusbar if there is a warning. @@ -214,7 +214,8 @@ |<>|Background color of the statusbar in caret mode with a selection |<>|Background color of the progress bar. |<>|Default foreground color of the URL in the statusbar. -|<>|Foreground color of the URL in the statusbar on successful load. +|<>|Foreground color of the URL in the statusbar on successful load (http). +|<>|Foreground color of the URL in the statusbar on successful load (https). |<>|Foreground color of the URL in the statusbar on error. |<>|Foreground color of the URL in the statusbar when there's a warning. |<>|Foreground color of the URL in the statusbar for hovered links. @@ -1662,7 +1663,7 @@ Default: +pass:[white]+ [[colors-statusbar.bg]] === statusbar.bg -Foreground color of the statusbar. +Background color of the statusbar. Default: +pass:[black]+ @@ -1764,7 +1765,13 @@ Default: +pass:[${statusbar.fg}]+ [[colors-statusbar.url.fg.success]] === statusbar.url.fg.success -Foreground color of the URL in the statusbar on successful load. +Foreground color of the URL in the statusbar on successful load (http). + +Default: +pass:[white]+ + +[[colors-statusbar.url.fg.success.https]] +=== statusbar.url.fg.success.https +Foreground color of the URL in the statusbar on successful load (https). Default: +pass:[lime]+ diff --git a/qutebrowser/browser/webview.py b/qutebrowser/browser/webview.py index 4c50a0212..49661294f 100644 --- a/qutebrowser/browser/webview.py +++ b/qutebrowser/browser/webview.py @@ -35,8 +35,8 @@ 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', - 'loading']) +LoadStatus = usertypes.enum('LoadStatus', ['none', 'success', 'success_https', + 'error', 'warn', 'loading']) tab_id_gen = itertools.count(0) @@ -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.scheme() == '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..ec4b051ba 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -878,7 +878,7 @@ def data(readonly=False): ('statusbar.bg', SettingValue(typ.QssColor(), 'black'), - "Foreground color of the statusbar."), + "Background color of the statusbar."), ('statusbar.fg.error', SettingValue(typ.QssColor(), '${statusbar.fg}'), @@ -947,9 +947,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..f903a15aa 100644 --- a/qutebrowser/mainwindow/statusbar/url.py +++ b/qutebrowser/mainwindow/statusbar/url.py @@ -28,8 +28,8 @@ 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', - 'normal']) +UrlType = usertypes.enum('UrlType', ['success', 'success_https', ' error', + 'warn', 'hover', 'normal']) class UrlText(textbase.TextBase): @@ -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,7 +120,9 @@ class UrlText(textbase.TextBase): status_str: The LoadStatus as string. """ status = webview.LoadStatus[status_str] - if status in (webview.LoadStatus.success, webview.LoadStatus.error, + if status in (webview.LoadStatus.success, + webview.LoadStatus.success_https, + webview.LoadStatus.error, webview.LoadStatus.warn): self._normal_url_type = UrlType[status_str] else: