Coverage for qutebrowser/misc/keyhintwidget.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 2016-2018 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net> # # 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/>.
When a user inputs a key that forms a partial match, this shows a small window with each possible completion of that keystring and the corresponding command. It is intended to help discoverability of keybindings. """
"""The view showing hints for key bindings based on the current key string.
Attributes: _win_id: Window ID of parent.
Signals: update_geometry: Emitted when this widget should be resized/positioned. """
QLabel { font: {{ conf.fonts.keyhint }}; color: {{ conf.colors.keyhint.fg }}; background-color: {{ conf.colors.keyhint.bg }}; padding: 6px; {% if conf.statusbar.position == 'top' %} border-bottom-right-radius: {{ conf.keyhint.radius }}px; {% else %} border-top-right-radius: {{ conf.keyhint.radius }}px; {% endif %} } """
def __repr__(self): return utils.get_repr(self, win_id=self._win_id)
"""Adjust the keyhint size when it's freshly shown."""
def update_keyhint(self, modename, prefix): """Show hints for the given prefix (or hide if prefix is empty).
Args: prefix: The current partial keystring. """
for glob in config.val.keyhint.blacklist)
"""Return true iff this command can take a count argument."""
if k.startswith(prefix) and not utils.is_special_key(k) and not blacklisted(k) and (takes_count(v) or not countstr)]
# delay so a quickly typed keychain doesn't display hints
"<tr>" "<td>{}</td>" "<td style='color: {}'>{}</td>" "<td style='padding-left: 2ex'>{}</td>" "</tr>" ).format( html.escape(prefix), suffix_color, html.escape(key[len(prefix):]), html.escape(cmd) )
|