Scrolling over tray icon support
This commit is contained in:
parent
75f9439843
commit
a9a616863d
@ -106,6 +106,8 @@ void BehaviourSettingsPage::Load() {
|
||||
|
||||
s.beginGroup(MainWindow::kSettingsGroup);
|
||||
ui_->b_show_tray_icon_->setChecked(s.value("showtray", true).toBool());
|
||||
ui_->b_scroll_tray_icon_->setChecked(
|
||||
s.value("scrolltrayicon", ui_->b_show_tray_icon_->isChecked()).toBool());
|
||||
ui_->b_keep_running_->setChecked(
|
||||
s.value("keeprunning", ui_->b_show_tray_icon_->isChecked()).toBool());
|
||||
ui_->doubleclick_addmode->setCurrentIndex(ui_->doubleclick_addmode->findData(
|
||||
@ -227,6 +229,7 @@ void BehaviourSettingsPage::Save() {
|
||||
|
||||
s.beginGroup(MainWindow::kSettingsGroup);
|
||||
s.setValue("showtray", ui_->b_show_tray_icon_->isChecked());
|
||||
s.setValue("scrolltrayicon", ui_->b_scroll_tray_icon_->isChecked());
|
||||
s.setValue("keeprunning", ui_->b_keep_running_->isChecked());
|
||||
s.setValue("startupbehaviour", int(behaviour));
|
||||
s.setValue("doubleclick_addmode", doubleclick_addmode);
|
||||
@ -266,4 +269,5 @@ void BehaviourSettingsPage::ShowTrayIconToggled(bool on) {
|
||||
ui_->b_remember_->setChecked(true);
|
||||
ui_->b_keep_running_->setEnabled(on);
|
||||
ui_->b_keep_running_->setChecked(on);
|
||||
ui_->b_scroll_tray_icon_->setEnabled(on);
|
||||
}
|
||||
|
@ -24,6 +24,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="b_scroll_tray_icon_">
|
||||
<property name="text">
|
||||
<string>Scroll over icon to change track</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="b_keep_running_">
|
||||
<property name="text">
|
||||
|
@ -85,8 +85,19 @@ bool QtSystemTrayIcon::eventFilter(QObject* object, QEvent* event) {
|
||||
emit PreviousTrack();
|
||||
}
|
||||
} else {
|
||||
QSettings s;
|
||||
s.beginGroup(MainWindow::kSettingsGroup);
|
||||
bool prev_next_track = s.value("scrolltrayicon").toBool();
|
||||
if(prev_next_track) {
|
||||
if (e->delta() < 0) {
|
||||
emit NextTrack();
|
||||
} else {
|
||||
emit PreviousTrack();
|
||||
}
|
||||
} else {
|
||||
emit ChangeVolume(e->delta());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#ifndef QTSYSTEMTRAYICON_H
|
||||
#define QTSYSTEMTRAYICON_H
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "systemtrayicon.h"
|
||||
|
||||
#include <QSystemTrayIcon>
|
||||
|
Loading…
x
Reference in New Issue
Block a user