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

Method create

Telegram/SourceFiles/tray.cpp:24–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24void Tray::create() {
25 rebuildMenu();
26 using WorkMode = Settings::WorkMode;
27 if (Core::App().settings().workMode() != WorkMode::WindowOnly) {
28 _tray.createIcon();
29 }
30
31 Core::App().settings().workModeValue(
32 ) | rpl::combine_previous(
33 ) | rpl::on_next([=](WorkMode previous, WorkMode state) {
34 const auto wasHasIcon = (previous != WorkMode::WindowOnly);
35 const auto nowHasIcon = (state != WorkMode::WindowOnly);
36 if (wasHasIcon != nowHasIcon) {
37 if (nowHasIcon) {
38 _tray.createIcon();
39 } else {
40 _tray.destroyIcon();
41 }
42 }
43 }, _tray.lifetime());
44
45 Core::App().settings().trayIconMonochromeChanges(
46 ) | rpl::on_next([=] {
47 updateIconCounters();
48 }, _tray.lifetime());
49
50 Core::App().passcodeLockChanges(
51 ) | rpl::on_next([=] {
52 rebuildMenu();
53 }, _tray.lifetime());
54
55 TrayAccountsMenu::SetupChangesSubscription(
56 [=] { rebuildMenu(); },
57 _tray.lifetime());
58
59 _tray.iconClicks(
60 ) | rpl::on_next([=] {
61 const auto skipTrayClick = (_lastTrayClickTime > 0)
62 && (crl::now() - _lastTrayClickTime
63 < QApplication::doubleClickInterval());
64 if (!skipTrayClick) {
65 _activeForTrayIconAction = Core::App().isActiveForTrayMenu();
66 _minimizeMenuItemClicks.fire({});
67 _lastTrayClickTime = crl::now();
68 }
69 }, _tray.lifetime());
70}
71
72void Tray::rebuildMenu() {
73 _tray.destroyMenu();

Callers 10

page.jsFile · 0.45
setupPasscodeLockMethod · 0.45
setupSetupEmailLockMethod · 0.45
showMediaPreviewMethod · 0.45
themeUpdatedMethod · 0.45
createPlayerMethod · 0.45
createCallTopBarMethod · 0.45
createExportTopBarMethod · 0.45
showNewSectionMethod · 0.45
createResizeAreaMethod · 0.45

Calls 12

AppClass · 0.85
workModeMethod · 0.80
settingsMethod · 0.80
workModeValueMethod · 0.80
passcodeLockChangesMethod · 0.80
SetupChangesSubscriptionFunction · 0.70
createIconMethod · 0.45
destroyIconMethod · 0.45
iconClicksMethod · 0.45
isActiveForTrayMenuMethod · 0.45
fireMethod · 0.45

Tested by

no test coverage detected