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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user