mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-24 20:35:50 +08:00
custom show tray icon
Closes #1569 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -58,6 +58,7 @@ class MainController extends GetxController
|
||||
late final optTabletNav = Pref.optTabletNav;
|
||||
|
||||
late bool directExitOnBack = Pref.directExitOnBack;
|
||||
late bool showTrayIcon = Pref.showTrayIcon;
|
||||
late bool minimizeOnExit = Pref.minimizeOnExit;
|
||||
late bool pauseOnMinimize = Pref.pauseOnMinimize;
|
||||
late bool isPlaying = false;
|
||||
|
||||
@@ -45,8 +45,10 @@ class _MainAppState extends State<MainApp>
|
||||
windowManager
|
||||
..addListener(this)
|
||||
..setPreventClose(true);
|
||||
trayManager.addListener(this);
|
||||
_handleTray();
|
||||
if (_mainController.showTrayIcon) {
|
||||
trayManager.addListener(this);
|
||||
_handleTray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +133,7 @@ class _MainAppState extends State<MainApp>
|
||||
|
||||
@override
|
||||
void onWindowClose() {
|
||||
if (_mainController.minimizeOnExit) {
|
||||
if (_mainController.showTrayIcon && _mainController.minimizeOnExit) {
|
||||
windowManager.hide();
|
||||
_onHideWindow();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user