Simplify logic
This commit is contained in:
parent
85d47dc64b
commit
08b4e3f2e0
1 changed files with 3 additions and 1 deletions
|
|
@ -1131,11 +1131,13 @@ def desktop_notify(self, osc_code: int, raw_datab: memoryview) -> None:
|
|||
|
||||
def clear_progress_if_needed(self, timer_id: int | None = None) -> None:
|
||||
# Clear stuck or completed progress
|
||||
if timer_id is not None: # this is a timer callback
|
||||
self.clear_progress_timer = 0
|
||||
if self.progress.clear_progress():
|
||||
if (tab := self.tabref()) is not None:
|
||||
tab.update_progress()
|
||||
else:
|
||||
if (timer_id is None and not self.clear_progress_timer) or timer_id is not None:
|
||||
if not self.clear_progress_timer:
|
||||
self.clear_progress_timer = add_timer(self.clear_progress_if_needed, 1.0, False)
|
||||
|
||||
def on_mouse_event(self, event: dict[str, Any]) -> bool:
|
||||
|
|
|
|||
Loading…
Reference in a new issue