alert_banenr: trying to fix non-clearing message issue

This commit is contained in:
2026-03-31 17:17:58 +02:00
parent 7bc0e056c9
commit eff25002e7
+6 -1
View File
@@ -11,6 +11,8 @@ class AlertBanner(QFrame):
def __init__(self, parent=None):
super().__init__(parent)
self._current_message = None
self._current_is_error = None
self._clear_timer = QTimer(self)
self._clear_timer.setSingleShot(True)
self._clear_timer.timeout.connect(self.clear_message)
@@ -81,7 +83,10 @@ class AlertBanner(QFrame):
" padding: 2px 6px 2px 6px;"
"}"
)
timeout = 5000 if auto_clear_ms is None else int(auto_clear_ms)
if auto_clear_ms is None:
timeout = 5000
else:
timeout = int(auto_clear_ms)
self._clear_timer.start(timeout)
self._current_message = msg