summaryrefslogtreecommitdiff
path: root/qutebrowser/mainwindow/statusbar
diff options
context:
space:
mode:
Diffstat (limited to 'qutebrowser/mainwindow/statusbar')
-rw-r--r--qutebrowser/mainwindow/statusbar/command.py3
-rw-r--r--qutebrowser/mainwindow/statusbar/url.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/qutebrowser/mainwindow/statusbar/command.py b/qutebrowser/mainwindow/statusbar/command.py
index b9c78d623..68bacd0b0 100644
--- a/qutebrowser/mainwindow/statusbar/command.py
+++ b/qutebrowser/mainwindow/statusbar/command.py
@@ -264,13 +264,14 @@ class Command(misc.CommandLineEdit):
text = cast(str, text)
super().setText(text)
- def keyPressEvent(self, e: QKeyEvent) -> None:
+ def keyPressEvent(self, e: Optional[QKeyEvent]) -> None:
"""Override keyPressEvent to ignore Return key presses, and add Shift-Ins.
If this widget is focused, we are in passthrough key mode, and
Enter/Shift+Enter/etc. will cause QLineEdit to think it's finished
without command_accept to be called.
"""
+ assert e is not None
if machinery.IS_QT5: # FIXME:v4 needed for Qt 5 typing
shift = cast(Qt.KeyboardModifiers, Qt.KeyboardModifier.ShiftModifier)
else:
diff --git a/qutebrowser/mainwindow/statusbar/url.py b/qutebrowser/mainwindow/statusbar/url.py
index 54faf232d..7892b3e83 100644
--- a/qutebrowser/mainwindow/statusbar/url.py
+++ b/qutebrowser/mainwindow/statusbar/url.py
@@ -116,7 +116,9 @@ class UrlText(textbase.TextBase):
if old_urltype != self._urltype:
# We can avoid doing an unpolish here because the new style will
# always override the old one.
- self.style().polish(self)
+ style = self.style()
+ assert style is not None
+ style.polish(self)
@pyqtSlot(usertypes.LoadStatus)
def on_load_status_changed(self, status):