Files
z-bar-qt/Greeter/Components/CustomMouseArea.qml
T
Zacharias-Brohn 6b482979fe greeter test
2026-03-18 23:39:37 +01:00

20 lines
378 B
QML

import QtQuick
MouseArea {
property int scrollAccumulatedY: 0
function onWheel(event: WheelEvent): void {
}
onWheel: event => {
if (Math.sign(event.angleDelta.y) !== Math.sign(scrollAccumulatedY))
scrollAccumulatedY = 0;
scrollAccumulatedY += event.angleDelta.y;
if (Math.abs(scrollAccumulatedY) >= 120) {
onWheel(event);
scrollAccumulatedY = 0;
}
}
}