Clear notification messages in a window when they're clicked.

This commit is contained in:
pkill9 2017-03-10 17:02:13 +00:00
parent 0b5838f9fd
commit 87c4c143bf
2 changed files with 9 additions and 0 deletions

View File

@ -407,6 +407,10 @@ def data(readonly=False):
SettingValue(typ.Bool(), 'true'),
"Show a filebrowser in upload/download prompts."),
('clear-messages-on-click',
SettingValue(typ.Bool(), 'false'),
"Whether to clear message notifications when they are clicked."),
readonly=readonly
)),

View File

@ -130,3 +130,8 @@ class MessageView(QWidget):
self._last_text = text
self.show()
self.update_geometry.emit()
def mousePressEvent(self, e):
if (config.get('ui', 'clear-messages-on-click') and
e.button() in [Qt.LeftButton, Qt.RightButton]):
self.clear_messages()