mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 17:59:43 +02:00
feat: add show widget to tray icon and show the gui on left click
This commit is contained in:
@@ -41,10 +41,16 @@ def run_gui(app):
|
|||||||
|
|
||||||
menu = QMenu()
|
menu = QMenu()
|
||||||
|
|
||||||
|
show = QAction("Show")
|
||||||
|
show.triggered.connect(lambda: widget.show())
|
||||||
|
menu.addAction(show)
|
||||||
|
|
||||||
quit = QAction("Quit")
|
quit = QAction("Quit")
|
||||||
quit.triggered.connect(lambda: (closehelper(), force_exit()))
|
quit.triggered.connect(lambda: (closehelper(), force_exit()))
|
||||||
menu.addAction(quit)
|
menu.addAction(quit)
|
||||||
|
|
||||||
|
tray.activated.connect(lambda reason: widget.show() if reason == QSystemTrayIcon.ActivationReason.Trigger else None)
|
||||||
|
|
||||||
tray.setContextMenu(menu)
|
tray.setContextMenu(menu)
|
||||||
|
|
||||||
# Check OS for window transparency compatibility and apply
|
# Check OS for window transparency compatibility and apply
|
||||||
|
|||||||
Reference in New Issue
Block a user