2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Fix build and tray icon menu on Windows.

This commit is contained in:
John Preston
2021-01-22 16:16:18 +04:00
parent 2616659116
commit 574d915c23
16 changed files with 169 additions and 92 deletions

View File

@@ -31,6 +31,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/ui_utility.h"
#include "apiwrap.h"
#include "mainwindow.h"
#include "mainwidget.h" // session->content()->windowShown().
#include "facades.h"
#include "app.h"
#include "styles/style_window.h"
@@ -296,6 +297,34 @@ void MainWindow::handleVisibleChanged(bool visible) {
handleVisibleChangedHook(visible);
}
void MainWindow::showFromTray() {
base::call_delayed(1, this, [this] {
updateTrayMenu();
updateGlobalMenu();
});
activate();
updateUnreadCounter();
}
void MainWindow::quitFromTray() {
App::quit();
}
void MainWindow::activate() {
bool wasHidden = !isVisible();
setWindowState(windowState() & ~Qt::WindowMinimized);
setVisible(true);
psActivateProcess();
raise();
activateWindow();
controller().updateIsActiveFocus();
if (wasHidden) {
if (const auto session = sessionController()) {
session->content()->windowShown();
}
}
}
void MainWindow::updatePalette() {
Ui::ForceFullRepaint(this);