Scroll the wallpaper picker with the mouse wheel
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a2aba82b0
commit
addf49800a
1 file changed
+12
@@ -91,6 +91,18 @@ PanelWindow {
|
|||||||
Keys.onReturnPressed:root.applyCurrent()
|
Keys.onReturnPressed:root.applyCurrent()
|
||||||
Keys.onEnterPressed:root.applyCurrent()
|
Keys.onEnterPressed:root.applyCurrent()
|
||||||
Keys.onEscapePressed:ShellState.wallpaperPickerOpen=false
|
Keys.onEscapePressed:ShellState.wallpaperPickerOpen=false
|
||||||
|
// A vertical mouse wheel steps through the horizontal strip, one tile per notch.
|
||||||
|
WheelHandler {
|
||||||
|
property real pending:0
|
||||||
|
acceptedDevices:PointerDevice.Mouse
|
||||||
|
onWheel:event=>{
|
||||||
|
pending+=event.angleDelta.y || event.angleDelta.x;
|
||||||
|
const steps=Math.trunc(pending/120);
|
||||||
|
if(!steps)return;
|
||||||
|
pending-=steps*120;
|
||||||
|
view.currentIndex=Math.max(0,Math.min(view.count-1,view.currentIndex-steps));
|
||||||
|
}
|
||||||
|
}
|
||||||
delegate:GlassPanel {
|
delegate:GlassPanel {
|
||||||
id:tile
|
id:tile
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|||||||
Reference in new issue
Block a user