Close search panel when Esc is pressed

This commit is contained in:
Kovid Goyal 2013-11-23 11:15:44 +05:30
parent bfba63b246
commit b8bb775a1b

View File

@ -292,3 +292,10 @@ class SearchPanel(QWidget):
ans = regex_cache[(flags, raw)] = regex.compile(raw, flags=flags)
return ans
def keyPressEvent(self, ev):
if ev.key() == Qt.Key_Escape:
self.hide_panel()
ev.accept()
else:
return QWidget.keyPressEvent(self, ev)