mirror of
https://github.com/rangermix/TwitchDropsMiner.git
synced 2026-05-31 09:29:37 +00:00
Fix the tray command line option not working
This commit is contained in:
18
.vscode/launch.json
vendored
18
.vscode/launch.json
vendored
@@ -20,6 +20,15 @@
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false
|
||||
},
|
||||
{
|
||||
"name": "Run App (INFO+Tray)",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "main.py",
|
||||
"args": ["--no-run-check", "-vv", "--tray"],
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false
|
||||
},
|
||||
{
|
||||
"name": "Run App (DEBUG)",
|
||||
"type": "python",
|
||||
@@ -46,14 +55,5 @@
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false
|
||||
},
|
||||
{
|
||||
"name": "Test ArgParser",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "main.py",
|
||||
"args": ["--excludes", "1", "2", "3"],
|
||||
"console": "integratedTerminal",
|
||||
"justMyCode": false
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
10
gui.py
10
gui.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user