1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 22:42:50 -05:00

Updates to scrolling logic

This commit is contained in:
purian23
2025-08-06 23:18:30 -04:00
parent 633927da9a
commit 722fd36c0a
13 changed files with 102 additions and 129 deletions

View File

@@ -114,9 +114,16 @@ Rectangle {
opacity: hasEvents ? 1 : 0
clip: true
spacing: Theme.spacingS
boundsMovement: Flickable.StopAtBounds
boundsBehavior: Flickable.StopAtBounds
// 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
boundsMovement: Flickable.FollowBoundsBehavior
pressDelay: 0
flickableDirection: Flickable.VerticalFlick
ScrollBar.vertical: ScrollBar {
policy: eventsList.contentHeight > eventsList.height ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff
}

View File

@@ -114,8 +114,9 @@ Column {
contentWidth: width
contentHeight: spanningNetworksColumn.height
boundsBehavior: Flickable.DragAndOvershootBounds
flickDeceleration: 8000
maximumFlickVelocity: 15000
// Enhanced native kinetic scrolling - Qt handles touch vs mouse automatically
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
Column {
id: spanningNetworksColumn

View File

@@ -84,8 +84,9 @@ Item {
contentWidth: width
contentHeight: wifiContent.height
boundsBehavior: Flickable.DragAndOvershootBounds
flickDeceleration: 8000
maximumFlickVelocity: 15000
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
Column {
id: wifiContent
@@ -115,8 +116,9 @@ Item {
contentWidth: width
contentHeight: ethernetContent.height
boundsBehavior: Flickable.StopAtBounds
flickDeceleration: 8000
maximumFlickVelocity: 15000
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
Column {
id: ethernetContent

View File

@@ -19,8 +19,13 @@ ListView {
spacing: Theme.spacingL
interactive: true
boundsBehavior: Flickable.StopAtBounds
flickDeceleration: 1500
maximumFlickVelocity: 2000
// Enhanced native kinetic scrolling - Qt handles touch vs mouse automatically
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
boundsMovement: Flickable.FollowBoundsBehavior
pressDelay: 0
flickableDirection: Flickable.VerticalFlick
cacheBuffer: 1000
onMovementStarted: isUserScrolling = true
onMovementEnded: {

View File

@@ -234,8 +234,6 @@ Column {
property real stableY: 0
property bool isUserScrolling: false
property bool isScrollBarDragging: false
property real wheelMultiplier: 1.8
property int wheelBaseStep: 160
property string keyRoleName: "pid"
property var _anchorKey: undefined
property real _anchorOffset: 0
@@ -278,39 +276,30 @@ Column {
spacing: 4
model: SysMonitorService.processes
boundsBehavior: Flickable.StopAtBounds
flickDeceleration: 1500
maximumFlickVelocity: 2000
// 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
boundsMovement: Flickable.FollowBoundsBehavior
pressDelay: 0
flickableDirection: Flickable.VerticalFlick
onMovementStarted: isUserScrolling = true
onMovementEnded: {
isUserScrolling = false;
if (contentY > 40)
stableY = contentY;
}
onContentYChanged: {
if (!isUserScrolling && !isScrollBarDragging && visible && stableY > 40 && Math.abs(contentY - stableY) > 10)
contentY = stableY;
}
onModelChanged: {
if (model && model.length > 0 && !isUserScrolling && stableY > 40)
Qt.callLater(function() {
contentY = stableY;
});
}
WheelHandler {
target: null
onWheel: (ev) => {
let dy = ev.pixelDelta.y !== 0 ? ev.pixelDelta.y : (ev.angleDelta.y / 120) * processListView.wheelBaseStep;
if (ev.inverted)
dy = -dy;
const maxY = Math.max(0, processListView.contentHeight - processListView.height);
processListView.contentY = Math.max(0, Math.min(maxY, processListView.contentY - dy * processListView.wheelMultiplier));
ev.accepted = true;
}
}
delegate: ProcessListItem {