init: working version
This commit is contained in:
commit
7d8d7dacae
109 changed files with 15066 additions and 0 deletions
22
custom/CustomMouseArea.qml
Normal file
22
custom/CustomMouseArea.qml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import QtQuick
|
||||
|
||||
MouseArea {
|
||||
property int scrollAccumulatedY: 0
|
||||
property int scrollThreshold: 160
|
||||
|
||||
function onWheel(event: WheelEvent): void {
|
||||
}
|
||||
|
||||
onWheel: event => {
|
||||
// Update accumulated scroll
|
||||
if (Math.sign(event.angleDelta.y) !== Math.sign(scrollAccumulatedY))
|
||||
scrollAccumulatedY = 0;
|
||||
scrollAccumulatedY += event.angleDelta.y;
|
||||
|
||||
// Trigger handler and reset if above threshold
|
||||
if (Math.abs(scrollAccumulatedY) >= scrollThreshold) {
|
||||
onWheel(event);
|
||||
scrollAccumulatedY = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue