mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
Updates to scrolling logic
This commit is contained in:
@@ -272,27 +272,20 @@ Rectangle {
|
||||
ListView {
|
||||
id: listView
|
||||
|
||||
property real wheelMultiplier: 1.8
|
||||
property int wheelBaseStep: 160
|
||||
|
||||
width: parent.width
|
||||
height: parent.height - (root.enableFuzzySearch ? searchContainer.height + Theme.spacingXS : 0)
|
||||
clip: true
|
||||
model: filteredOptions
|
||||
spacing: 2
|
||||
|
||||
WheelHandler {
|
||||
target: null
|
||||
onWheel: (ev) => {
|
||||
let dy = ev.pixelDelta.y !== 0 ? ev.pixelDelta.y : (ev.angleDelta.y / 120) * parent.wheelBaseStep;
|
||||
if (ev.inverted)
|
||||
dy = -dy;
|
||||
|
||||
const maxY = Math.max(0, parent.contentHeight - parent.height);
|
||||
parent.contentY = Math.max(0, Math.min(maxY, parent.contentY - dy * parent.wheelMultiplier));
|
||||
ev.accepted = true;
|
||||
}
|
||||
}
|
||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
||||
interactive: true
|
||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||
boundsMovement: Flickable.FollowBoundsBehavior
|
||||
pressDelay: 0
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AsNeeded
|
||||
|
||||
@@ -18,8 +18,6 @@ GridView {
|
||||
property int minIconSize: 32
|
||||
property bool hoverUpdatesSelection: true
|
||||
property bool keyboardNavigationActive: false
|
||||
property real wheelMultiplier: 1.8
|
||||
property int wheelBaseStep: 160
|
||||
property int baseCellWidth: adaptiveColumns ? Math.max(minCellWidth, Math.min(maxCellWidth, width / columns)) : (width - Theme.spacingS * 2) / columns
|
||||
property int baseCellHeight: baseCellWidth + 20
|
||||
property int actualColumns: adaptiveColumns ? Math.floor(width / cellWidth) : columns
|
||||
@@ -55,21 +53,14 @@ GridView {
|
||||
rightMargin: leftMargin
|
||||
focus: true
|
||||
interactive: true
|
||||
flickDeceleration: 300
|
||||
maximumFlickVelocity: 30000
|
||||
|
||||
WheelHandler {
|
||||
target: null
|
||||
onWheel: (ev) => {
|
||||
let dy = ev.pixelDelta.y !== 0 ? ev.pixelDelta.y : (ev.angleDelta.y / 120) * gridView.wheelBaseStep;
|
||||
if (ev.inverted)
|
||||
dy = -dy;
|
||||
|
||||
const maxY = Math.max(0, gridView.contentHeight - gridView.height);
|
||||
gridView.contentY = Math.max(0, Math.min(maxY, gridView.contentY - dy * gridView.wheelMultiplier));
|
||||
ev.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||
boundsMovement: Flickable.FollowBoundsBehavior
|
||||
pressDelay: 0
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AsNeeded
|
||||
|
||||
@@ -13,8 +13,6 @@ ListView {
|
||||
property int itemSpacing: Theme.spacingS
|
||||
property bool hoverUpdatesSelection: true
|
||||
property bool keyboardNavigationActive: false
|
||||
property real wheelMultiplier: 1.8
|
||||
property int wheelBaseStep: 160
|
||||
|
||||
signal keyboardNavigationReset()
|
||||
signal itemClicked(int index, var modelData)
|
||||
@@ -36,28 +34,21 @@ ListView {
|
||||
onCurrentIndexChanged: {
|
||||
if (keyboardNavigationActive)
|
||||
ensureVisible(currentIndex);
|
||||
|
||||
}
|
||||
|
||||
clip: true
|
||||
anchors.margins: itemSpacing
|
||||
spacing: itemSpacing
|
||||
focus: true
|
||||
interactive: true
|
||||
flickDeceleration: 600
|
||||
maximumFlickVelocity: 30000
|
||||
|
||||
WheelHandler {
|
||||
target: null
|
||||
onWheel: (ev) => {
|
||||
let dy = ev.pixelDelta.y !== 0 ? ev.pixelDelta.y : (ev.angleDelta.y / 120) * wheelBaseStep;
|
||||
if (ev.inverted)
|
||||
dy = -dy;
|
||||
|
||||
const maxY = Math.max(0, contentHeight - height);
|
||||
contentY = Math.max(0, Math.min(maxY, contentY - dy * wheelMultiplier));
|
||||
ev.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||
boundsMovement: Flickable.FollowBoundsBehavior
|
||||
pressDelay: 0
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: ScrollBar.AlwaysOn
|
||||
|
||||
@@ -258,6 +258,15 @@ Item {
|
||||
model: searchResultsModel
|
||||
spacing: 2
|
||||
|
||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
||||
interactive: true
|
||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||
boundsMovement: Flickable.FollowBoundsBehavior
|
||||
pressDelay: 0
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
|
||||
delegate: StyledRect {
|
||||
width: searchResultsList.width
|
||||
height: 36
|
||||
|
||||
@@ -102,6 +102,15 @@ Popup {
|
||||
spacing: Theme.spacingS
|
||||
model: root.allWidgets
|
||||
|
||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
||||
interactive: true
|
||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||
boundsMovement: Flickable.FollowBoundsBehavior
|
||||
pressDelay: 0
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
|
||||
delegate: Rectangle {
|
||||
width: widgetList.width
|
||||
height: 60
|
||||
|
||||
Reference in New Issue
Block a user