diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 0050add992..c2a6e1b95a 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -990,6 +990,8 @@ PRIVATE platform/linux/notifications_manager_linux.h platform/linux/specific_linux.cpp platform/linux/specific_linux.h + platform/linux/tray_linux.cpp + platform/linux/tray_linux.h platform/mac/file_utilities_mac.mm platform/mac/file_utilities_mac.h platform/mac/launcher_mac.mm @@ -1005,6 +1007,8 @@ PRIVATE platform/mac/specific_mac.h platform/mac/specific_mac_p.mm platform/mac/specific_mac_p.h + platform/mac/tray_mac.mm + platform/mac/tray_mac.h platform/mac/window_title_mac.mm platform/mac/touchbar/items/mac_formatter_item.h platform/mac/touchbar/items/mac_formatter_item.mm @@ -1038,6 +1042,8 @@ PRIVATE platform/win/notifications_manager_win.h platform/win/specific_win.cpp platform/win/specific_win.h + platform/win/tray_win.cpp + platform/win/tray_win.h platform/win/windows_app_user_model_id.cpp platform/win/windows_app_user_model_id.h platform/win/windows_dlls.cpp @@ -1054,6 +1060,7 @@ PRIVATE platform/platform_main_window.h platform/platform_notifications_manager.h platform/platform_specific.h + platform/platform_tray.h platform/platform_window_title.h profile/profile_back_button.cpp profile/profile_back_button.h @@ -1260,6 +1267,8 @@ PRIVATE settings.cpp settings.h stdafx.h + tray.cpp + tray.h ) if (NOT build_winstore) diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 2cb67dd262..fc8177ccc4 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "lang/lang_instance.h" #include "inline_bots/bot_attach_web_view.h" #include "mainwidget.h" +#include "tray.h" #include "core/file_utilities.h" #include "core/click_handler_types.h" // ClickHandlerContext. #include "core/crash_reports.h" @@ -149,6 +150,7 @@ Application::Application(not_null launcher) , _langpack(std::make_unique()) , _langCloudManager(std::make_unique(langpack())) , _emojiKeywords(std::make_unique()) +, _tray(std::make_unique()) , _autoLockTimer([=] { checkAutoLock(); }) { Ui::Integration::Set(&_private->uiIntegration); @@ -300,6 +302,8 @@ void Application::run() { startShortcuts(); startDomain(); + startTray(); + _primaryWindow->widget()->show(); const auto currentGeometry = _primaryWindow->widget()->geometry(); @@ -409,6 +413,9 @@ void Application::startSystemDarkModeViewer() { }, _lifetime); } +void Application::startTray() { +} + auto Application::prepareEmojiSourceImages() -> std::shared_ptr { const auto &images = Ui::Emoji::SourceImages(); diff --git a/Telegram/SourceFiles/core/application.h b/Telegram/SourceFiles/core/application.h index cff4bea88f..ae3240cd9e 100644 --- a/Telegram/SourceFiles/core/application.h +++ b/Telegram/SourceFiles/core/application.h @@ -103,6 +103,7 @@ namespace Core { class Launcher; struct LocalUrlHandler; +class Tray; enum class LaunchState { Running, @@ -317,6 +318,7 @@ private: void startDomain(); void startEmojiImageLoader(); void startSystemDarkModeViewer(); + void startTray(); friend void QuitAttempt(); void quitDelayed(); @@ -377,6 +379,8 @@ private: std::unique_ptr _translator; QPointer _badProxyDisableBox; + const std::unique_ptr _tray; + std::unique_ptr _floatPlayers; Media::Player::FloatDelegate *_defaultFloatPlayerDelegate = nullptr; Media::Player::FloatDelegate *_replacementFloatPlayerDelegate = nullptr; diff --git a/Telegram/SourceFiles/platform/linux/tray_linux.cpp b/Telegram/SourceFiles/platform/linux/tray_linux.cpp new file mode 100644 index 0000000000..216cbcf6d8 --- /dev/null +++ b/Telegram/SourceFiles/platform/linux/tray_linux.cpp @@ -0,0 +1,15 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#include "platform/linux/tray_linux.h" + +namespace Platform { + +Tray::Tray() { +} + +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/linux/tray_linux.h b/Telegram/SourceFiles/platform/linux/tray_linux.h new file mode 100644 index 0000000000..d0a89b2854 --- /dev/null +++ b/Telegram/SourceFiles/platform/linux/tray_linux.h @@ -0,0 +1,22 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +#include "platform/platform_tray.h" + +namespace Platform { + +class Tray final { +public: + Tray(); + +private: + +}; + +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/mac/tray_mac.h b/Telegram/SourceFiles/platform/mac/tray_mac.h new file mode 100644 index 0000000000..d0a89b2854 --- /dev/null +++ b/Telegram/SourceFiles/platform/mac/tray_mac.h @@ -0,0 +1,22 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +#include "platform/platform_tray.h" + +namespace Platform { + +class Tray final { +public: + Tray(); + +private: + +}; + +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/mac/tray_mac.mm b/Telegram/SourceFiles/platform/mac/tray_mac.mm new file mode 100644 index 0000000000..4f800239d2 --- /dev/null +++ b/Telegram/SourceFiles/platform/mac/tray_mac.mm @@ -0,0 +1,15 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#include "platform/mac/tray_mac.h" + +namespace Platform { + +Tray::Tray() { +} + +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/platform_tray.h b/Telegram/SourceFiles/platform/platform_tray.h new file mode 100644 index 0000000000..3d6b907241 --- /dev/null +++ b/Telegram/SourceFiles/platform/platform_tray.h @@ -0,0 +1,24 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +namespace Platform { + +class Tray; + +} // namespace Platform + +// Platform dependent implementations. + +#ifdef Q_OS_MAC +#include "platform/mac/tray_mac.h" +#elif defined Q_OS_UNIX // Q_OS_MAC +#include "platform/linux/tray_linux.h" +#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_UNIX +#include "platform/win/tray_win.h" +#endif // Q_OS_MAC || Q_OS_UNIX || Q_OS_WIN diff --git a/Telegram/SourceFiles/platform/win/tray_win.cpp b/Telegram/SourceFiles/platform/win/tray_win.cpp new file mode 100644 index 0000000000..b487846b1b --- /dev/null +++ b/Telegram/SourceFiles/platform/win/tray_win.cpp @@ -0,0 +1,15 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#include "platform/win/tray_win.h" + +namespace Platform { + +Tray::Tray() { +} + +} // namespace Platform diff --git a/Telegram/SourceFiles/platform/win/tray_win.h b/Telegram/SourceFiles/platform/win/tray_win.h new file mode 100644 index 0000000000..d0a89b2854 --- /dev/null +++ b/Telegram/SourceFiles/platform/win/tray_win.h @@ -0,0 +1,22 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +#include "platform/platform_tray.h" + +namespace Platform { + +class Tray final { +public: + Tray(); + +private: + +}; + +} // namespace Platform diff --git a/Telegram/SourceFiles/tray.cpp b/Telegram/SourceFiles/tray.cpp new file mode 100644 index 0000000000..f608a9ab49 --- /dev/null +++ b/Telegram/SourceFiles/tray.cpp @@ -0,0 +1,15 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#include "tray.h" + +namespace Core { + +Tray::Tray() { +} + +} // namespace Core diff --git a/Telegram/SourceFiles/tray.h b/Telegram/SourceFiles/tray.h new file mode 100644 index 0000000000..3e5a0c9d60 --- /dev/null +++ b/Telegram/SourceFiles/tray.h @@ -0,0 +1,23 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +#include "platform/platform_tray.h" + +namespace Core { + +class Tray final { +public: + Tray(); + +private: + Platform::Tray _tray; + +}; + +} // namespace Core