Change timer interval after appending to _messages
This commit is contained in:
parent
a631c971d9
commit
1cb23f1193
@ -99,10 +99,7 @@ class MessageView(QWidget):
|
||||
"""Configure self._clear_timer according to the config."""
|
||||
interval = config.get('ui', 'message-timeout')
|
||||
if interval != 0:
|
||||
multimpy_by = len(self._messages) + 1
|
||||
if multimpy_by > 5:
|
||||
multimpy_by = 5
|
||||
interval *= multimpy_by
|
||||
interval *= min(5, len(self._messages))
|
||||
self._clear_timer.setInterval(interval)
|
||||
|
||||
@pyqtSlot()
|
||||
@ -130,13 +127,13 @@ class MessageView(QWidget):
|
||||
widget = Message(level, text, replace=replace, parent=self)
|
||||
self._vbox.addWidget(widget)
|
||||
widget.show()
|
||||
if config.get('ui', 'message-timeout') != 0:
|
||||
self._set_clear_timer_interval()
|
||||
self._clear_timer.start()
|
||||
self._messages.append(widget)
|
||||
self._last_text = text
|
||||
self.show()
|
||||
self.update_geometry.emit()
|
||||
if config.get('ui', 'message-timeout') != 0:
|
||||
self._set_clear_timer_interval()
|
||||
self._clear_timer.start()
|
||||
|
||||
def mousePressEvent(self, e):
|
||||
"""Clear messages when they are clicked on."""
|
||||
|
Loading…
Reference in New Issue
Block a user