2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Moved WorkMode global variable from facades to core settings.

This commit is contained in:
23rd
2021-05-27 22:45:52 +03:00
parent 16db8468fa
commit 5334372671
13 changed files with 64 additions and 36 deletions

View File

@@ -343,7 +343,7 @@ void SetupSystemIntegrationContent(
};
if (Platform::TrayIconSupported()) {
const auto trayEnabled = [] {
const auto workMode = Global::WorkMode().value();
const auto workMode = Core::App().settings().workMode();
return (workMode == dbiwmTrayOnly)
|| (workMode == dbiwmWindowAndTray);
};
@@ -352,7 +352,7 @@ void SetupSystemIntegrationContent(
trayEnabled());
const auto taskbarEnabled = [] {
const auto workMode = Global::WorkMode().value();
const auto workMode = Core::App().settings().workMode();
return (workMode == dbiwmWindowOnly)
|| (workMode == dbiwmWindowAndTray);
};
@@ -369,10 +369,10 @@ void SetupSystemIntegrationContent(
: dbiwmTrayOnly)
: dbiwmWindowOnly;
if ((newMode == dbiwmWindowAndTray || newMode == dbiwmTrayOnly)
&& Global::WorkMode().value() != newMode) {
&& Core::App().settings().workMode() != newMode) {
cSetSeenTrayTooltip(false);
}
Global::RefWorkMode().set(newMode);
Core::App().settings().setWorkMode(newMode);
Local::writeSettings();
};