Add scrolling for volume icon
This commit is contained in:
parent
4baab691f0
commit
763cb4e148
1 changed files with 16 additions and 0 deletions
|
|
@ -41,4 +41,20 @@ Item {
|
||||||
pillIndicator.show()
|
pillIndicator.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
acceptedButtons: Qt.NoButton // Accept wheel events only
|
||||||
|
propagateComposedEvents: true
|
||||||
|
onWheel: {
|
||||||
|
if (!shell) return;
|
||||||
|
let step = 5;
|
||||||
|
if (wheel.angleDelta.y > 0) {
|
||||||
|
shell.volume = Math.min(100, shell.volume + step);
|
||||||
|
} else if (wheel.angleDelta.y < 0) {
|
||||||
|
shell.volume = Math.max(0, shell.volume - step);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue