2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 00:55:12 +00:00

Adapt indicator-application check for sandboxed environments

Fix quality loss in the tray icon image

Fix window showing by clicking on the tray icon on macOS

Fix tray icon displaying on KDE
This commit is contained in:
Ilya Fedin
2020-02-06 15:34:28 +04:00
committed by John Preston
parent 9e3fa2e4bc
commit 6206b6f843
9 changed files with 98 additions and 57 deletions

View File

@@ -556,8 +556,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *e) {
void MainWindow::updateTrayMenu(bool force) {
if (!trayIconMenu || (Platform::IsWindows() && !force)) return;
auto iconMenu = trayIconMenu;
auto actions = iconMenu->actions();
auto actions = trayIconMenu->actions();
if (Platform::IsLinux()) {
auto minimizeAction = actions.at(1);
minimizeAction->setEnabled(isVisible());
@@ -571,12 +570,6 @@ void MainWindow::updateTrayMenu(bool force) {
toggleAction->setText(active
? tr::lng_minimize_to_tray(tr::now)
: tr::lng_open_from_tray(tr::now));
// On macOS just remove trayIcon menu if the window is not active.
// So we will activate the window on click instead of showing the menu.
if (!active && Platform::IsMac()) {
iconMenu = nullptr;
}
}
auto notificationAction = actions.at(Platform::IsLinux() ? 2 : 1);
auto notificationActionText = Global::DesktopNotify()