Merge branch 'neeasade-url-color'

This commit is contained in:
Florian Bruhin 2015-10-15 18:35:56 +02:00
commit ebd576d98f
6 changed files with 37 additions and 12 deletions

View File

@ -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
~~~~~~~

View File

@ -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

View File

@ -197,7 +197,7 @@
|<<colors-completion.item.selected.border.bottom,completion.item.selected.border.bottom>>|Bottom border color of the selected completion item.
|<<colors-completion.match.fg,completion.match.fg>>|Foreground color of the matched text in the completion.
|<<colors-statusbar.fg,statusbar.fg>>|Foreground color of the statusbar.
|<<colors-statusbar.bg,statusbar.bg>>|Foreground color of the statusbar.
|<<colors-statusbar.bg,statusbar.bg>>|Background color of the statusbar.
|<<colors-statusbar.fg.error,statusbar.fg.error>>|Foreground color of the statusbar if there was an error.
|<<colors-statusbar.bg.error,statusbar.bg.error>>|Background color of the statusbar if there was an error.
|<<colors-statusbar.fg.warning,statusbar.fg.warning>>|Foreground color of the statusbar if there is a warning.
@ -214,7 +214,8 @@
|<<colors-statusbar.bg.caret-selection,statusbar.bg.caret-selection>>|Background color of the statusbar in caret mode with a selection
|<<colors-statusbar.progress.bg,statusbar.progress.bg>>|Background color of the progress bar.
|<<colors-statusbar.url.fg,statusbar.url.fg>>|Default foreground color of the URL in the statusbar.
|<<colors-statusbar.url.fg.success,statusbar.url.fg.success>>|Foreground color of the URL in the statusbar on successful load.
|<<colors-statusbar.url.fg.success,statusbar.url.fg.success>>|Foreground color of the URL in the statusbar on successful load (http).
|<<colors-statusbar.url.fg.success.https,statusbar.url.fg.success.https>>|Foreground color of the URL in the statusbar on successful load (https).
|<<colors-statusbar.url.fg.error,statusbar.url.fg.error>>|Foreground color of the URL in the statusbar on error.
|<<colors-statusbar.url.fg.warn,statusbar.url.fg.warn>>|Foreground color of the URL in the statusbar when there's a warning.
|<<colors-statusbar.url.fg.hover,statusbar.url.fg.hover>>|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]+

View File

@ -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:

View File

@ -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'),

View File

@ -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: