Add scrolling for volume icon

This commit is contained in:
ly-sec 2025-07-14 14:23:22 +02:00
parent 4baab691f0
commit 763cb4e148

View file

@ -41,4 +41,20 @@ Item {
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);
}
}
}
}