mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-24 11:15:33 +03:00
Update tray functionality
When the tray option is enabled closing the last window doesn't close the application.
This commit is contained in:
parent
b4f39f628f
commit
8beda56cb2
2
main.cpp
2
main.cpp
@ -70,6 +70,7 @@ int main(int argc, char *argv[])
|
||||
engine.rootContext()->setContextProperty("appVersion", APP_VERSION);
|
||||
engine.rootContext()->setContextProperty("ScreenShot", &screenshot);
|
||||
engine.rootContext()->setContextProperty("SysTrayIcon", trayIcon);
|
||||
engine.rootContext()->setContextProperty("app", &app);
|
||||
engine.load(QUrl(url_prefix + main_qml));
|
||||
|
||||
// This is the current system tray icon.
|
||||
@ -101,6 +102,5 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
#endif
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
return app.exec();
|
||||
}
|
||||
|
11
qml/main.qml
11
qml/main.qml
@ -90,10 +90,6 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
function updateTrayVisability() {
|
||||
SysTrayIcon.visible = settings.closeToTray
|
||||
}
|
||||
|
||||
AboutPage {
|
||||
id: aboutPage
|
||||
}
|
||||
@ -568,4 +564,11 @@ ApplicationWindow {
|
||||
credentialMenu.popup()
|
||||
}
|
||||
}
|
||||
|
||||
function updateTrayVisability() {
|
||||
SysTrayIcon.visible = settings.closeToTray
|
||||
// When the tray option is enabled, closing the last window
|
||||
// doesn't actually close the application.
|
||||
app.quitOnLastWindowClosed = !settings.closeToTray
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user