mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Add scrolling for volume icon
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user