Only hide temporary error message on non-modifiers

This commit is contained in:
Florian Bruhin 2014-02-19 14:57:31 +01:00
parent cb47ae1b43
commit c2e3039702
2 changed files with 14 additions and 1 deletions

View File

@ -107,7 +107,7 @@ class QuteBrowser(QApplication):
self.setQuitOnLastWindowClosed(False) self.setQuitOnLastWindowClosed(False)
self.lastWindowClosed.connect(self.shutdown) self.lastWindowClosed.connect(self.shutdown)
self.mainwindow.tabs.keypress.connect( self.mainwindow.tabs.keypress.connect(
self.mainwindow.status.clear_tmp_text) self.mainwindow.status.keypress)
self.mainwindow.tabs.keypress.connect(self.keyparser.handle) self.mainwindow.tabs.keypress.connect(self.keyparser.handle)
self.keyparser.set_cmd_text.connect( self.keyparser.set_cmd_text.connect(
self.mainwindow.status.cmd.set_cmd_text) self.mainwindow.status.cmd.set_cmd_text)

View File

@ -170,6 +170,19 @@ class StatusBar(QWidget):
"""Clear a temporary text.""" """Clear a temporary text."""
self.disp_tmp_text('') self.disp_tmp_text('')
@pyqtSlot('QKeyEvent')
def keypress(self, e):
"""Hide temporary error message if a key was pressed.
Args:
e: The original QKeyEvent.
"""
if e.key() in [Qt.Key_Control, Qt.Key_Alt, Qt.Key_Shift, Qt.Key_Meta]:
# Only modifier pressed, don't hide yet.
return
self.clear_tmp_text()
def resizeEvent(self, e): def resizeEvent(self, e):
"""Extend resizeEvent of QWidget to emit a resized signal afterwards. """Extend resizeEvent of QWidget to emit a resized signal afterwards.