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

Moved DBIWorkMode to Core::Settings.

This commit is contained in:
23rd
2021-05-28 01:11:16 +03:00
parent da3e140069
commit 707b36dc12
16 changed files with 63 additions and 52 deletions

View File

@@ -179,7 +179,7 @@ MainWindow::MainWindow(not_null<Controller*> controller)
}, lifetime());
Core::App().settings().workModeChanges(
) | rpl::start_with_next([=](DBIWorkMode mode) {
) | rpl::start_with_next([=](Core::Settings::WorkMode mode) {
workmodeUpdated(mode);
}, lifetime());
@@ -211,7 +211,8 @@ bool MainWindow::hideNoQuit() {
return false;
}
const auto workMode = Core::App().settings().workMode();
if (workMode == dbiwmTrayOnly || workMode == dbiwmWindowAndTray) {
if (workMode == Core::Settings::WorkMode::TrayOnly
|| workMode == Core::Settings::WorkMode::WindowAndTray) {
if (minimizeToTray()) {
if (const auto controller = sessionController()) {
Ui::showChatsList(&controller->session());
@@ -316,8 +317,9 @@ void MainWindow::handleStateChanged(Qt::WindowState state) {
controller().updateIsActiveFocus();
}
Core::App().updateNonIdle();
using WorkMode = Core::Settings::WorkMode;
if (state == Qt::WindowMinimized
&& (Core::App().settings().workMode() == dbiwmTrayOnly)) {
&& (Core::App().settings().workMode() == WorkMode::TrayOnly)) {
minimizeToTray();
}
savePosition(state);