1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

revise listview/gridview scrolling

This commit is contained in:
bbedward
2025-07-25 17:46:03 -04:00
parent f26c01916b
commit 1157b0336f
2 changed files with 4 additions and 38 deletions

View File

@@ -17,7 +17,6 @@ ScrollView {
property real iconSizeRatio: 0.6
property int maxIconSize: 56
property int minIconSize: 32
property real wheelStepSize: 60
property bool hoverUpdatesSelection: true
property bool keyboardNavigationActive: false
@@ -63,24 +62,8 @@ ScrollView {
rightMargin: leftMargin
focus: true
interactive: true
flickDeceleration: 8000
maximumFlickVelocity: 15000
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
propagateComposedEvents: true
z: -1
onWheel: function(wheel) {
var delta = wheel.angleDelta.y;
var steps = delta / 120;
grid.contentY -= steps * wheelStepSize;
if (grid.contentY < 0)
grid.contentY = 0;
else if (grid.contentY > grid.contentHeight - grid.height)
grid.contentY = Math.max(0, grid.contentHeight - grid.height);
}
}
flickDeceleration: 300
maximumFlickVelocity: 30000
delegate: Rectangle {
width: grid.cellWidth - cellPadding

View File

@@ -11,7 +11,6 @@ ScrollView {
property int currentIndex: 0
property int itemHeight: 72
property int iconSize: 56
property real wheelStepSize: 60
property bool showDescription: true
property int itemSpacing: Theme.spacingS
property bool hoverUpdatesSelection: true
@@ -52,24 +51,8 @@ ScrollView {
focus: true
interactive: true
currentIndex: listView.currentIndex
flickDeceleration: 8000
maximumFlickVelocity: 15000
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
propagateComposedEvents: true
z: -1
onWheel: function(wheel) {
var delta = wheel.angleDelta.y;
var steps = delta / 120;
list.contentY -= steps * wheelStepSize;
if (list.contentY < 0)
list.contentY = 0;
else if (list.contentY > list.contentHeight - list.height)
list.contentY = Math.max(0, list.contentHeight - list.height);
}
}
flickDeceleration: 600
maximumFlickVelocity: 30000
delegate: Rectangle {
width: list.width