mirror of https://github.com/KDE/kasts.git
Enable middle-click on systray icon to play/pause
This commit is contained in:
parent
6dbe0fd921
commit
739e046837
|
@ -21,12 +21,17 @@ SystrayIcon::SystrayIcon(QObject *parent)
|
||||||
: QSystemTrayIcon(parent)
|
: QSystemTrayIcon(parent)
|
||||||
{
|
{
|
||||||
setIconColor(intToIconColorEnum(SettingsManager::self()->trayIconType()));
|
setIconColor(intToIconColorEnum(SettingsManager::self()->trayIconType()));
|
||||||
|
setToolTip(i18nc("@info:tooltip",
|
||||||
|
"Kasts\n"
|
||||||
|
"Middle-click to play/pause"));
|
||||||
|
|
||||||
QMenu *menu = new QMenu();
|
QMenu *menu = new QMenu();
|
||||||
|
|
||||||
connect(this, &QSystemTrayIcon::activated, this, [this](QSystemTrayIcon::ActivationReason reason) {
|
connect(this, &QSystemTrayIcon::activated, this, [this](QSystemTrayIcon::ActivationReason reason) {
|
||||||
if (reason == QSystemTrayIcon::Trigger) {
|
if (reason == QSystemTrayIcon::Trigger) {
|
||||||
Q_EMIT raiseWindow();
|
Q_EMIT raiseWindow();
|
||||||
|
} else if (reason == QSystemTrayIcon::MiddleClick) {
|
||||||
|
AudioManager::instance().playPause();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue