Fix the tray command line option not working

This commit is contained in:
DevilXD committed 2022-03-17 11:28:17 +01:00
1 parent 12fdf7ab96
commit ccf7fbf96d
2 files changed
+14 -14

No files matched your search

+5 -5
View File
@@ -891,9 +891,6 @@ class TrayIcon:
self.icon: pystray.Icon | None = None
self._button = ttk.Button(master, command=self.minimize, text="Minimize to Tray")
self._button.grid(column=0, row=0, sticky="ne")
if manager._twitch.settings.tray:
# start hidden in tray
self._manager._root.after_idle(self.minimize)
def is_tray(self) -> bool:
return self.icon is not None
@@ -1284,8 +1281,11 @@ class GUIManager:
self._handler = _TKOutputHandler(self)
self._handler.setFormatter(FORMATTER)
logging.getLogger("TwitchDrops").addHandler(self._handler)
# show the window when ready
if not self._twitch.settings.tray:
# stay hidden in tray if needed, otherwise show the window when everything's ready
if self._twitch.settings.tray:
# NOTE: this starts the tray icon thread
self._root.after_idle(self.tray.minimize)
else:
self._root.deiconify()
# https://stackoverflow.com/questions/56329342/tkinter-treeview-background-tag-not-working