diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-08-26 17:12:45 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-08-26 17:12:45 +0200 |
commit | 735f1774e4c622ea50a4576d180daecfc0698918 (patch) | |
tree | e0d4026e651ce32d0909502942189f196fdeb23f /qutebrowser | |
parent | 6afa00c465327a118dbcff46fa85b6df53037263 (diff) | |
download | qutebrowser-735f1774e4c622ea50a4576d180daecfc0698918.tar.gz qutebrowser-735f1774e4c622ea50a4576d180daecfc0698918.zip |
API stuff
Diffstat (limited to 'qutebrowser')
-rw-r--r-- | qutebrowser/keyinput/keyutils.py | 6 | ||||
-rw-r--r-- | qutebrowser/mainwindow/mainwindow.py | 2 | ||||
-rw-r--r-- | qutebrowser/mainwindow/statusbar/command.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/qutebrowser/keyinput/keyutils.py b/qutebrowser/keyinput/keyutils.py index d03220a7a..387e1ac4b 100644 --- a/qutebrowser/keyinput/keyutils.py +++ b/qutebrowser/keyinput/keyutils.py @@ -472,9 +472,9 @@ class KeySequence: def __iter__(self) -> Iterator[KeyInfo]: """Iterate over KeyInfo objects.""" for key_and_modifiers in self._iter_keys(): - key = Qt.Key(int(key_and_modifiers) & ~Qt.KeyboardModifier.KeyboardModifierMask) - modifiers = Qt.KeyboardModifier( # type: ignore[call-overload] - int(key_and_modifiers) & Qt.KeyboardModifier.KeyboardModifierMask) + # key = Qt.Key(int(key_and_modifiers) & ~Qt.KeyboardModifier.KeyboardModifierMask) + key = key_and_modifiers.key() + modifiers = key_and_modifiers.keyboardModifiers() yield KeyInfo(key=key, modifiers=modifiers) def __repr__(self) -> str: diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index a3e6722af..1d694a45a 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -565,7 +565,7 @@ class MainWindow(QWidget): refresh_window = self.isVisible() if hidden: window_flags |= Qt.WindowType.CustomizeWindowHint | Qt.WindowType.NoDropShadowWindowHint - self.setWindowFlags(cast(Qt.WindowFlags, window_flags)) + self.setWindowFlags(window_flags) if refresh_window: self.show() diff --git a/qutebrowser/mainwindow/statusbar/command.py b/qutebrowser/mainwindow/statusbar/command.py index dbb4a4626..bbcf16c7b 100644 --- a/qutebrowser/mainwindow/statusbar/command.py +++ b/qutebrowser/mainwindow/statusbar/command.py @@ -276,7 +276,7 @@ class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit): text = self.text() if not text: text = 'x' - width = self.fontMetrics().width(text) + width = self.fontMetrics().horizontalAdvance(text) return QSize(width, height) @pyqtSlot() |