Coverage for qutebrowser/mainwindow/statusbar/url.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # qutebrowser is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
# Note this has entries for success/error/warn from widgets.webview:LoadStatus 'hover', 'normal'])
"""URL displayed in the statusbar.
Attributes: _normal_url: The normal URL to be displayed as a UrlType instance. _normal_url_type: The type of the normal URL as a UrlType instance. _hover_url: The URL we're currently hovering over. _ssl_errors: Whether SSL errors occurred while loading.
Class attributes: _urltype: The URL type to show currently (normal/ok/error/warn/hover). Accessed via the urltype property.
For some reason we need to have this as class attribute so pyqtProperty works correctly. """
QLabel#UrlText[urltype="normal"] { color: {{ conf.colors.statusbar.url.fg }}; }
QLabel#UrlText[urltype="success"] { color: {{ conf.colors.statusbar.url.success.http.fg }}; }
QLabel#UrlText[urltype="success_https"] { color: {{ conf.colors.statusbar.url.success.https.fg }}; }
QLabel#UrlText[urltype="error"] { color: {{ conf.colors.statusbar.url.error.fg }}; }
QLabel#UrlText[urltype="warn"] { color: {{ conf.colors.statusbar.url.warn.fg }}; }
QLabel#UrlText[urltype="hover"] { color: {{ conf.colors.statusbar.url.hover.fg }}; } """
"""Override TextBase.__init__ to elide in the middle by default."""
def urltype(self): """Getter for self.urltype, so it can be used as Qt property.
Return: The urltype as a string (!) """ else:
"""Update the displayed URL if the url or the hover url changed.""" else:
def on_load_status_changed(self, status_str): """Slot for load_status_changed. Sets URL color accordingly.
Args: status_str: The LoadStatus as string. """ usertypes.LoadStatus.success_https, usertypes.LoadStatus.error, usertypes.LoadStatus.warn]: else:
def set_url(self, url): """Setter to be used as a Qt slot.
Args: url: The URL to set as QUrl, or None. """ else:
def set_hover_url(self, link): """Setter to be used as a Qt slot.
Saves old shown URL in self._old_url and restores it later if a link is "un-hovered" when it gets called with empty parameters.
Args: link: The link which was hovered (string) """ else: else:
"""Update URL if the tab changed.""" else: |