mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Clarify system tray code
If the tray is disabled in settings, we no longer allow the command line parameter to override it and create a tray icon regardless. This matches the behavior in the UI, where "minimize to tray on startup" becomes unavailable if the "tray enabled" setting is unselected.
This commit is contained in:
parent
e8c3ad1482
commit
76fcfa9ed3
|
@ -7592,12 +7592,11 @@ void OBSBasic::SystemTray(bool firstStarted)
|
|||
if (firstStarted)
|
||||
SystemTrayInit();
|
||||
|
||||
if (!sysTrayWhenStarted && !sysTrayEnabled) {
|
||||
if (!sysTrayEnabled) {
|
||||
trayIcon->hide();
|
||||
} else if ((sysTrayWhenStarted && sysTrayEnabled) ||
|
||||
opt_minimize_tray) {
|
||||
} else {
|
||||
trayIcon->show();
|
||||
if (firstStarted) {
|
||||
if (firstStarted && (sysTrayWhenStarted || opt_minimize_tray)) {
|
||||
QTimer::singleShot(50, this, SLOT(hide()));
|
||||
EnablePreviewDisplay(false);
|
||||
setVisible(false);
|
||||
|
@ -7606,12 +7605,6 @@ void OBSBasic::SystemTray(bool firstStarted)
|
|||
#endif
|
||||
opt_minimize_tray = false;
|
||||
}
|
||||
} else if (sysTrayEnabled) {
|
||||
trayIcon->show();
|
||||
} else if (!sysTrayEnabled) {
|
||||
trayIcon->hide();
|
||||
} else if (!sysTrayWhenStarted && sysTrayEnabled) {
|
||||
trayIcon->hide();
|
||||
}
|
||||
|
||||
if (isVisible())
|
||||
|
|
Loading…
Reference in a new issue