From 5589cfb783f903fda67d046b057144e0c4eac254 Mon Sep 17 00:00:00 2001 From: bbedward Date: Thu, 16 Jul 2026 10:41:16 -0400 Subject: [PATCH] dash/weather: fix X wheel scroll port 1.5 --- quickshell/Modules/DankDash/WeatherTab.qml | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/quickshell/Modules/DankDash/WeatherTab.qml b/quickshell/Modules/DankDash/WeatherTab.qml index 437ed1556..0622a46b5 100644 --- a/quickshell/Modules/DankDash/WeatherTab.qml +++ b/quickshell/Modules/DankDash/WeatherTab.qml @@ -936,7 +936,7 @@ Item { id: dailyLoader anchors.fill: parent sourceComponent: dailyComponent - active: root.visible && root.available + active: root.visible && root.available && width > 0 && height > 0 visible: !root.showHourly asynchronous: true opacity: 0 @@ -953,7 +953,7 @@ Item { id: hourlyLoader anchors.fill: parent sourceComponent: hourlyComponent - active: root.visible && root.available + active: root.visible && root.available && width > 0 && height > 0 visible: root.showHourly asynchronous: true opacity: 0 @@ -1038,6 +1038,7 @@ Item { MouseArea { anchors.fill: parent + property real hWheelAccum: 0 onWheel: wheel => { if (wheel.modifiers & Qt.ShiftModifier) { if (wheel.angleDelta.y % 120 == 0 && wheel.angleDelta.x == 0) { @@ -1049,6 +1050,15 @@ Item { } } } + if (wheel.angleDelta.x !== 0) { + hWheelAccum += wheel.angleDelta.x; + const steps = Math.trunc(hWheelAccum / 120); + hWheelAccum -= steps * 120; + if (steps !== 0) + hourlyList.currentIndex = Math.max(0, Math.min(hourlyList.model - 1, hourlyList.currentIndex - steps)); + wheel.accepted = true; + return; + } wheel.accepted = false; } } @@ -1096,6 +1106,7 @@ Item { MouseArea { anchors.fill: parent + property real hWheelAccum: 0 onWheel: wheel => { if (wheel.modifiers & Qt.ShiftModifier) { if (wheel.angleDelta.y % 120 == 0 && wheel.angleDelta.x == 0) { @@ -1107,6 +1118,15 @@ Item { } } } + if (wheel.angleDelta.x !== 0) { + hWheelAccum += wheel.angleDelta.x; + const steps = Math.trunc(hWheelAccum / 120); + hWheelAccum -= steps * 120; + if (steps !== 0) + dailyList.currentIndex = Math.max(0, Math.min(dailyList.model - 1, dailyList.currentIndex - steps)); + wheel.accepted = true; + return; + } wheel.accepted = false; } }