MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / applyInitialWorkMode

Method applyInitialWorkMode

Telegram/SourceFiles/mainwindow.cpp:116–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void MainWindow::applyInitialWorkMode() {
117 const auto workMode = Core::App().settings().workMode();
118 workmodeUpdated(workMode);
119
120 if (controller().isPrimary()) {
121 if (Core::App().settings().windowPosition().maximized) {
122 DEBUG_LOG(("Window Pos: First show, setting maximized."));
123 setWindowState(Qt::WindowMaximized);
124 }
125 if (cStartInTray()
126 || (cLaunchMode() == LaunchModeAutoStart
127 && cStartMinimized()
128 && !Core::App().passcodeLocked())) {
129 DEBUG_LOG(("Window Pos: First show, setting minimized after."));
130 if (workMode == Core::Settings::WorkMode::TrayOnly
131 || workMode == Core::Settings::WorkMode::WindowAndTray) {
132 hide();
133 } else {
134 setWindowState(windowState() | Qt::WindowMinimized);
135 }
136 }
137 }
138 setPositionInited();
139}
140
141void MainWindow::finishFirstShow() {
142 applyInitialWorkMode();

Callers

nothing calls this directly

Calls 5

AppClass · 0.85
workModeMethod · 0.80
settingsMethod · 0.80
passcodeLockedMethod · 0.80
isPrimaryMethod · 0.45

Tested by

no test coverage detected