Re-focus web view when leaving prompt/yesno mode.

This commit is contained in:
Florian Bruhin 2014-12-28 00:41:50 +01:00
parent 03ac8874ff
commit 89c7f3ecfe

View File

@ -508,9 +508,11 @@ class TabbedBrowser(tabwidget.TabWidget):
@pyqtSlot(usertypes.KeyMode)
def on_mode_left(self, mode):
"""Give focus to current tab if command mode was left."""
if mode == usertypes.KeyMode.command:
if mode in (usertypes.KeyMode.command, usertypes.KeyMode.prompt,
usertypes.KeyMode.yesno):
widget = self.currentWidget()
log.modes.debug("Left command mode, focusing {!r}".format(widget))
log.modes.debug("Left status-input mode, focusing {!r}".format(
widget))
if widget is None:
return
widget.setFocus()