diff --git a/qutebrowser/widgets/mainwindow.py b/qutebrowser/widgets/mainwindow.py index 74184acad..50d13136a 100644 --- a/qutebrowser/widgets/mainwindow.py +++ b/qutebrowser/widgets/mainwindow.py @@ -25,6 +25,7 @@ class MainWindow(QMainWindow): self.tabs.cur_progress.connect(self.status.prog.set_progress) self.tabs.cur_load_finished.connect(self.status.prog.load_finished) + self.status.cmd.esc_pressed.connect(self.tabs.setFocus) #self.retranslateUi(MainWindow) #self.tabWidget.setCurrentIndex(0) diff --git a/qutebrowser/widgets/statusbar.py b/qutebrowser/widgets/statusbar.py index 5a649d0ac..62eaf8729 100644 --- a/qutebrowser/widgets/statusbar.py +++ b/qutebrowser/widgets/statusbar.py @@ -106,6 +106,7 @@ class StatusText(QLabel): class StatusCommand(QLineEdit): got_cmd = pyqtSignal(str) parent = None + esc_pressed = pyqtSignal() def __init__(self, parent): super().__init__(parent) @@ -118,8 +119,7 @@ class StatusCommand(QLineEdit): self.esc = QShortcut(self) self.esc.setKey(QKeySequence(Qt.Key_Escape)) self.esc.setContext(Qt.WidgetWithChildrenShortcut) - # FIXME this is fugly and doesn't clear the keystring - self.esc.activated.connect(parent.parent.tabs.setFocus) + self.esc.activated.connect(self.esc_pressed) def process_cmd(self): text = self.text().lstrip(':')