Changeset e449f27db26a…
Parent 8c18b18f1146…
by
Changes to 2 files · Browse files at e449f27db26a Showing diff from parent 8c18b18f1146 Diff from another changeset...
@@ -785,6 +785,11 @@ def addRightWidget(self, w):
self.layout().insertWidget(self.layout().count() - 1, w)
+ def keyPressEvent(self, event):
+ if event.key() == Qt.Key_Escape:
+ self.close()
+ super(InfoBar, self).keyPressEvent(event)
+
class StatusInfoBar(InfoBar):
"""Show status message"""
def __init__(self, message, parent=None):
@@ -829,6 +834,9 @@ self._buttons.rejected.connect(self._reject)
self.addWidget(self._buttons)
+ # so that acceptButton gets focus by default
+ self.setFocusProxy(self._buttons)
+
def closeEvent(self, event):
if self.isVisible():
self.rejected.emit()
|
@@ -240,6 +240,7 @@ w = cls(*args, **kwargs)
w.linkActivated.connect(self._openLink)
self._infobarlayout.insertWidget(0, w)
+ w.setFocus() # to handle key press by InfoBar
return w
def clearInfoBar(self, priority=None):
|
Loading...