From 1157b0336f88ec4e8785e9c3cabcc48a0eafed31 Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 25 Jul 2025 17:46:03 -0400 Subject: [PATCH] revise listview/gridview scrolling --- Widgets/DankGridView.qml | 21 ++------------------- Widgets/DankListView.qml | 21 ++------------------- 2 files changed, 4 insertions(+), 38 deletions(-) diff --git a/Widgets/DankGridView.qml b/Widgets/DankGridView.qml index a4cfcc61..b19f1578 100644 --- a/Widgets/DankGridView.qml +++ b/Widgets/DankGridView.qml @@ -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 diff --git a/Widgets/DankListView.qml b/Widgets/DankListView.qml index c756ea20..0bc0f4e9 100644 --- a/Widgets/DankListView.qml +++ b/Widgets/DankListView.qml @@ -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