1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-23 16:28:19 +01:00

Reverse volume slider direction with horizontal scroll.

Fixes #5064
This commit is contained in:
John Maguire 2015-10-08 13:31:29 +01:00
parent 8f84a53273
commit 3aac164f1e

View File

@ -49,9 +49,7 @@ void Amarok::Slider::wheelEvent(QWheelEvent* e) {
// Position Slider (horizontal) // Position Slider (horizontal)
int step = e->delta() * 1500 / 18; int step = e->delta() * 1500 / 18;
int nval = QSlider::value() + step; int nval = qBound(minimum(), QSlider::value() + step, maximum());
nval = qMax(nval, minimum());
nval = qMin(nval, maximum());
QSlider::setValue(nval); QSlider::setValue(nval);
@ -274,9 +272,8 @@ void Amarok::VolumeSlider::slideEvent(QMouseEvent* e) {
} }
void Amarok::VolumeSlider::wheelEvent(QWheelEvent* e) { void Amarok::VolumeSlider::wheelEvent(QWheelEvent* e) {
const uint step = e->delta() / 30; const uint step = e->delta() / (e->orientation() == Qt::Vertical ? 30 : -30);
QSlider::setValue(QSlider::value() + step); QSlider::setValue(QSlider::value() + step);
emit sliderReleased(value()); emit sliderReleased(value());
} }