2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Completely removed common and platform code for tray from main window.

This commit is contained in:
23rd
2022-04-21 22:33:27 +03:00
parent 9de372d715
commit 0e16a50bbc
12 changed files with 4 additions and 244 deletions

View File

@@ -255,24 +255,11 @@ void MainWindow::initHook() {
LOG(("System tray available: %1").arg(Logs::b(TrayIconSupported())));
}
bool MainWindow::hasTrayIcon() const {
return trayIcon;
}
bool MainWindow::isActiveForTrayMenu() {
updateIsActive();
return Platform::IsWayland() ? isVisible() : isActive();
}
void MainWindow::psShowTrayMenu() {
}
void MainWindow::psTrayMenuUpdated() {
}
void MainWindow::psSetupTrayIcon() {
}
void MainWindow::workmodeUpdated(Core::Settings::WorkMode mode) {
if (!TrayIconSupported()) {
return;
@@ -329,9 +316,6 @@ void MainWindow::updateIconCounters() {
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
}
void MainWindow::initTrayMenuHook() {
}
void MainWindow::createGlobalMenu() {
const auto ensureWindowShown = [=] {
if (isHidden()) {

View File

@@ -22,8 +22,6 @@ class MainWindow : public Window::MainWindow {
public:
explicit MainWindow(not_null<Window::Controller*> controller);
void psShowTrayMenu();
bool isActiveForTrayMenu() override;
~MainWindow();
@@ -35,21 +33,10 @@ protected:
void unreadCounterChangedHook() override;
void updateGlobalMenuHook() override;
void initTrayMenuHook() override;
bool hasTrayIcon() const override;
void workmodeUpdated(Core::Settings::WorkMode mode) override;
void createGlobalMenu() override;
QSystemTrayIcon *trayIcon = nullptr;
QMenu *trayIconMenu = nullptr;
void psTrayMenuUpdated();
void psSetupTrayIcon();
private:
base::unique_qptr<Ui::PopupMenu> _trayIconMenuXEmbed;
QMenuBar *psMainMenu = nullptr;
QAction *psLogout = nullptr;
QAction *psUndo = nullptr;

View File

@@ -33,6 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
#include <QtWidgets/QApplication>
#include <QtWidgets/QSystemTrayIcon>
#include <QtCore/QStandardPaths>
#include <QtCore/QProcess>
#include <QtGui/QWindow>