Change how wheel scrolling works in qml grid views

This fixes scrolling in Qt6
This commit is contained in:
Luis Ángel San Martín 2023-01-14 14:15:30 +01:00
parent dec297a63c
commit 8f0619887c
4 changed files with 12 additions and 4 deletions

View File

@ -428,7 +428,7 @@ Rectangle {
return; return;
} }
var newValue = Math.min((grid.contentHeight - grid.height - (true ? main.continuReadingHeight : main.topContentMargin)), (Math.max(grid.originY , grid.contentY - event.angleDelta.y))); var newValue = Math.min((grid.contentHeight - grid.height + grid.originY), (Math.max(grid.originY , grid.contentY - event.angleDelta.y)));
grid.contentY = newValue; grid.contentY = newValue;
} }
} }

View File

@ -430,11 +430,19 @@ Rectangle {
return; return;
} }
var newValue = Math.min((grid.contentHeight - grid.height - (true ? main.continuReadingHeight : main.topContentMargin)), (Math.max(grid.originY , grid.contentY - event.angleDelta.y))); var newValue = Math.min((grid.contentHeight - grid.height + grid.originY), (Math.max(grid.originY , grid.contentY - event.angleDelta.y)));
grid.contentY = newValue; grid.contentY = newValue;
} }
} }
onOriginYChanged: {
console.log(" origin changed ", grid.originY)
}
onContentYChanged: {
console.log(" content y changed ", grid.contentY)
}
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {
visible: grid.contentHeight > grid.height visible: grid.contentHeight > grid.height

View File

@ -715,7 +715,7 @@ SplitView {
return; return;
} }
var newValue = Math.min((grid.contentHeight - grid.height - (showCurrentComic ? 270 : 20)), (Math.max(grid.originY , grid.contentY - event.angleDelta.y))); var newValue = Math.min((grid.contentHeight - grid.height + grid.originY), (Math.max(grid.originY , grid.contentY - event.angleDelta.y)));
grid.contentY = newValue; grid.contentY = newValue;
} }
} }

View File

@ -722,7 +722,7 @@ SplitView {
return; return;
} }
var newValue = Math.min((grid.contentHeight - grid.height - (showCurrentComic ? 270 : 20)), (Math.max(grid.originY , grid.contentY - event.angleDelta.y))); var newValue = Math.min((grid.contentHeight - grid.height + grid.originY), (Math.max(grid.originY , grid.contentY - event.angleDelta.y)));
grid.contentY = newValue; grid.contentY = newValue;
} }
} }