mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 23:05:48 +02:00
mainapplication: add "Show Jami" tray icon context menu item
On some desktop environments on GNU/Linux, left-clicking on the tray icon does not execute the restore action. In some environments, such as Ubuntu and some other GNOME-based environments, double-clicking the icon does that, but that's counter-intuitive and not obvious at all to the user. So, we add a 'Show Jami' menu item for the system tray context menu, similar to how jami-gnome did, so the user can clearly see it as a possible action. Change-Id: I1e12ba02190c12cf40d293d61e1f023380fbfcf9
This commit is contained in:
parent
262f3de515
commit
7bb0e06dbc
1 changed files with 4 additions and 0 deletions
|
@ -489,6 +489,9 @@ MainApplication::initSystray()
|
||||||
QAction* quitAction = new QAction(quitString, this);
|
QAction* quitAction = new QAction(quitString, this);
|
||||||
connect(quitAction, &QAction::triggered, this, &MainApplication::cleanup);
|
connect(quitAction, &QAction::triggered, this, &MainApplication::cleanup);
|
||||||
|
|
||||||
|
QAction* restoreAction = new QAction(tr("&Show Jami"), this);
|
||||||
|
connect(restoreAction, &QAction::triggered, this, &MainApplication::restoreApp);
|
||||||
|
|
||||||
connect(systemTray_.get(),
|
connect(systemTray_.get(),
|
||||||
&QSystemTrayIcon::activated,
|
&QSystemTrayIcon::activated,
|
||||||
[this](QSystemTrayIcon::ActivationReason reason) {
|
[this](QSystemTrayIcon::ActivationReason reason) {
|
||||||
|
@ -505,6 +508,7 @@ MainApplication::initSystray()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
systrayMenu->addAction(restoreAction);
|
||||||
systrayMenu->addAction(quitAction);
|
systrayMenu->addAction(quitAction);
|
||||||
systemTray_->setContextMenu(systrayMenu);
|
systemTray_->setContextMenu(systrayMenu);
|
||||||
systemTray_->show();
|
systemTray_->show();
|
||||||
|
|
Loading…
Add table
Reference in a new issue