mirror of
https://github.com/rangermix/TwitchDropsMiner.git
synced 2026-05-30 17:09:36 +00:00
modify tray.notify to return a task for cancelling purposes
This commit is contained in:
7
gui.py
7
gui.py
@@ -824,7 +824,9 @@ class TrayIcon:
|
||||
self.stop()
|
||||
self._manager._root.deiconify()
|
||||
|
||||
def notify(self, message: str, title: str | None = None, duration: float = 10):
|
||||
def notify(
|
||||
self, message: str, title: str | None = None, duration: float = 10
|
||||
) -> asyncio.Task[None] | None:
|
||||
if self.icon is not None:
|
||||
icon = self.icon
|
||||
|
||||
@@ -833,7 +835,8 @@ class TrayIcon:
|
||||
await asyncio.sleep(duration)
|
||||
icon.remove_notification()
|
||||
|
||||
asyncio.create_task(notifier())
|
||||
return asyncio.create_task(notifier())
|
||||
return None
|
||||
|
||||
def update_title(self, drop: TimedDrop):
|
||||
if self.icon is not None:
|
||||
|
||||
Reference in New Issue
Block a user