mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
Update more scrolling enhancements
This commit is contained in:
@@ -439,10 +439,10 @@ DankModal {
|
|||||||
model: filteredClipboardModel
|
model: filteredClipboardModel
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
interactive: true
|
interactive: true
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500 // Touch only in Qt 6.9+ // Lower = more momentum, longer scrolling
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000 // Touch only in Qt 6.9+ // Higher = faster maximum scroll speed
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
|
|||||||
@@ -203,10 +203,10 @@ DankModal {
|
|||||||
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded }
|
ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded }
|
||||||
ScrollBar.horizontal: ScrollBar { policy: ScrollBar.AlwaysOff }
|
ScrollBar.horizontal: ScrollBar { policy: ScrollBar.AlwaysOff }
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
interactive: true
|
interactive: true
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500 // Touch only in Qt 6.9+ // Lower = more momentum, longer scrolling
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000 // Touch only in Qt 6.9+ // Higher = faster maximum scroll speed
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
|
|||||||
@@ -96,14 +96,26 @@ DankModal {
|
|||||||
contentWidth: width
|
contentWidth: width
|
||||||
contentHeight: detailsRect.height
|
contentHeight: detailsRect.height
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
interactive: true
|
interactive: true
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 60
|
||||||
|
let newY = parent.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
|
||||||
|
parent.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: detailsRect
|
id: detailsRect
|
||||||
|
|||||||
@@ -116,14 +116,35 @@ Rectangle {
|
|||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
interactive: true
|
interactive: true
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
property real momentum: 0
|
||||||
|
onWheel: (event) => {
|
||||||
|
if (event.pixelDelta.y !== 0) {
|
||||||
|
// Touchpad with pixel delta
|
||||||
|
momentum = event.pixelDelta.y * 1.8
|
||||||
|
} else {
|
||||||
|
// Mouse wheel with angle delta
|
||||||
|
momentum = (event.angleDelta.y / 120) * (60 * 2.5) // ~2.5 items per wheel step
|
||||||
|
}
|
||||||
|
|
||||||
|
let newY = parent.contentY - momentum
|
||||||
|
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
|
||||||
|
parent.contentY = newY
|
||||||
|
momentum *= 0.92 // Decay for smooth momentum
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
ScrollBar.vertical: ScrollBar {
|
||||||
policy: eventsList.contentHeight > eventsList.height ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff
|
policy: eventsList.contentHeight > eventsList.height ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,9 +114,21 @@ Column {
|
|||||||
contentWidth: width
|
contentWidth: width
|
||||||
contentHeight: spanningNetworksColumn.height
|
contentHeight: spanningNetworksColumn.height
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||||
// Enhanced native kinetic scrolling - Qt handles touch vs mouse automatically
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 60
|
||||||
|
let newY = parent.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
|
||||||
|
parent.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: spanningNetworksColumn
|
id: spanningNetworksColumn
|
||||||
|
|||||||
@@ -84,9 +84,21 @@ Item {
|
|||||||
contentWidth: width
|
contentWidth: width
|
||||||
contentHeight: wifiContent.height
|
contentHeight: wifiContent.height
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 60
|
||||||
|
let newY = parent.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
|
||||||
|
parent.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: wifiContent
|
id: wifiContent
|
||||||
@@ -116,9 +128,21 @@ Item {
|
|||||||
contentWidth: width
|
contentWidth: width
|
||||||
contentHeight: ethernetContent.height
|
contentHeight: ethernetContent.height
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 60
|
||||||
|
let newY = parent.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
|
||||||
|
parent.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: ethernetContent
|
id: ethernetContent
|
||||||
|
|||||||
@@ -20,13 +20,35 @@ ListView {
|
|||||||
interactive: true
|
interactive: true
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - Qt handles touch vs mouse automatically
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
cacheBuffer: 1000
|
cacheBuffer: 1000
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
property real momentum: 0
|
||||||
|
onWheel: (event) => {
|
||||||
|
if (event.pixelDelta.y !== 0) {
|
||||||
|
// Touchpad with pixel delta
|
||||||
|
momentum = event.pixelDelta.y * 1.8
|
||||||
|
} else {
|
||||||
|
// Mouse wheel with angle delta
|
||||||
|
momentum = (event.angleDelta.y / 120) * (parent.spacing * 2.5) // ~2.5 items per wheel step
|
||||||
|
}
|
||||||
|
|
||||||
|
let newY = parent.contentY - momentum
|
||||||
|
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
|
||||||
|
parent.contentY = newY
|
||||||
|
momentum *= 0.92 // Decay for smooth momentum
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMovementStarted: isUserScrolling = true
|
onMovementStarted: isUserScrolling = true
|
||||||
onMovementEnded: {
|
onMovementEnded: {
|
||||||
isUserScrolling = false;
|
isUserScrolling = false;
|
||||||
|
|||||||
@@ -277,10 +277,10 @@ Column {
|
|||||||
model: SysMonitorService.processes
|
model: SysMonitorService.processes
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
interactive: true
|
interactive: true
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500 // Touch only in Qt 6.9+ // Lower = more momentum, longer scrolling
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000 // Touch only in Qt 6.9+ // Higher = faster maximum scroll speed
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|||||||
@@ -8,6 +8,20 @@ import qs.Widgets
|
|||||||
ScrollView {
|
ScrollView {
|
||||||
id: appearanceTab
|
id: appearanceTab
|
||||||
|
|
||||||
|
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
|
||||||
|
let flickable = appearanceTab.contentItem
|
||||||
|
let newY = flickable.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
|
||||||
|
flickable.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
contentWidth: availableWidth
|
contentWidth: availableWidth
|
||||||
contentHeight: column.implicitHeight + Theme.spacingXL
|
contentHeight: column.implicitHeight + Theme.spacingXL
|
||||||
clip: true
|
clip: true
|
||||||
|
|||||||
@@ -7,6 +7,20 @@ import qs.Widgets
|
|||||||
ScrollView {
|
ScrollView {
|
||||||
id: launcherTab
|
id: launcherTab
|
||||||
|
|
||||||
|
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
|
||||||
|
let flickable = launcherTab.contentItem
|
||||||
|
let newY = flickable.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
|
||||||
|
flickable.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
contentHeight: column.implicitHeight + Theme.spacingXL
|
contentHeight: column.implicitHeight + Theme.spacingXL
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,20 @@ import qs.Widgets
|
|||||||
ScrollView {
|
ScrollView {
|
||||||
id: personalizationTab
|
id: personalizationTab
|
||||||
|
|
||||||
|
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
|
||||||
|
let flickable = personalizationTab.contentItem
|
||||||
|
let newY = flickable.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
|
||||||
|
flickable.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property alias profileBrowser: profileBrowserLoader.item
|
property alias profileBrowser: profileBrowserLoader.item
|
||||||
property alias wallpaperBrowser: wallpaperBrowserLoader.item
|
property alias wallpaperBrowser: wallpaperBrowserLoader.item
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,20 @@ import qs.Widgets
|
|||||||
ScrollView {
|
ScrollView {
|
||||||
id: timeWeatherTab
|
id: timeWeatherTab
|
||||||
|
|
||||||
|
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
|
||||||
|
let flickable = timeWeatherTab.contentItem
|
||||||
|
let newY = flickable.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
|
||||||
|
flickable.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
contentHeight: column.implicitHeight
|
contentHeight: column.implicitHeight
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,20 @@ import qs.Widgets
|
|||||||
ScrollView {
|
ScrollView {
|
||||||
id: widgetsTab
|
id: widgetsTab
|
||||||
|
|
||||||
|
// Qt 6.9+ scrolling: Enhanced mouse wheel and touchpad responsiveness
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
onWheel: (event) => {
|
||||||
|
let delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 80
|
||||||
|
let flickable = widgetsTab.contentItem
|
||||||
|
let newY = flickable.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(flickable.contentHeight - flickable.height, newY))
|
||||||
|
flickable.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property var baseWidgetDefinitions: [{
|
property var baseWidgetDefinitions: [{
|
||||||
"id": "launcherButton",
|
"id": "launcherButton",
|
||||||
"text": "App Launcher",
|
"text": "App Launcher",
|
||||||
|
|||||||
@@ -278,10 +278,10 @@ Rectangle {
|
|||||||
model: filteredOptions
|
model: filteredOptions
|
||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
interactive: true
|
interactive: true
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500 // Touch only in Qt 6.9+ // Lower = more momentum, longer scrolling
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000 // Touch only in Qt 6.9+ // Higher = faster maximum scroll speed
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
|
|||||||
@@ -54,13 +54,67 @@ GridView {
|
|||||||
focus: true
|
focus: true
|
||||||
interactive: true
|
interactive: true
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
|
// Performance optimizations
|
||||||
|
cacheBuffer: Math.min(height * 2, 1000)
|
||||||
|
reuseItems: true
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
id: wheelHandler
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
|
||||||
|
// Tunable parameters for responsive scrolling
|
||||||
|
property real mouseWheelSpeed: 20 // Higher = faster mouse wheel
|
||||||
|
property real touchpadSpeed: 1.8 // Touchpad sensitivity
|
||||||
|
property real momentumRetention: 0.92
|
||||||
|
property real lastWheelTime: 0
|
||||||
|
property real momentum: 0
|
||||||
|
|
||||||
|
onWheel: (event) => {
|
||||||
|
let currentTime = Date.now()
|
||||||
|
let timeDelta = currentTime - lastWheelTime
|
||||||
|
lastWheelTime = currentTime
|
||||||
|
|
||||||
|
// Calculate scroll delta based on input type
|
||||||
|
let delta = 0
|
||||||
|
if (event.pixelDelta.y !== 0) {
|
||||||
|
// Touchpad with pixel precision
|
||||||
|
delta = event.pixelDelta.y * touchpadSpeed
|
||||||
|
} else {
|
||||||
|
// Mouse wheel - larger steps for faster scrolling
|
||||||
|
delta = event.angleDelta.y / 120 * cellHeight * 2 // 2 cells per wheel step
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply momentum for touchpad (smooth continuous scrolling)
|
||||||
|
if (event.pixelDelta.y !== 0 && timeDelta < 50) {
|
||||||
|
momentum = momentum * momentumRetention + delta * 0.15
|
||||||
|
delta += momentum
|
||||||
|
} else {
|
||||||
|
momentum = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply scrolling with proper bounds checking
|
||||||
|
let newY = contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(
|
||||||
|
contentHeight - height, newY))
|
||||||
|
|
||||||
|
// Cancel any conflicting flicks and apply new position
|
||||||
|
if (flicking) {
|
||||||
|
cancelFlick()
|
||||||
|
}
|
||||||
|
|
||||||
|
contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
ScrollBar.vertical: ScrollBar {
|
||||||
policy: ScrollBar.AsNeeded
|
policy: ScrollBar.AsNeeded
|
||||||
|
|||||||
@@ -42,13 +42,67 @@ ListView {
|
|||||||
focus: true
|
focus: true
|
||||||
interactive: true
|
interactive: true
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
|
// Performance optimizations
|
||||||
|
cacheBuffer: Math.min(height * 2, 1000)
|
||||||
|
reuseItems: true
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
id: wheelHandler
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
|
||||||
|
// Tunable parameters for responsive scrolling
|
||||||
|
property real mouseWheelSpeed: 20 // Higher = faster mouse wheel
|
||||||
|
property real touchpadSpeed: 1.8 // Touchpad sensitivity
|
||||||
|
property real momentumRetention: 0.92
|
||||||
|
property real lastWheelTime: 0
|
||||||
|
property real momentum: 0
|
||||||
|
|
||||||
|
onWheel: (event) => {
|
||||||
|
let currentTime = Date.now()
|
||||||
|
let timeDelta = currentTime - lastWheelTime
|
||||||
|
lastWheelTime = currentTime
|
||||||
|
|
||||||
|
// Calculate scroll delta based on input type
|
||||||
|
let delta = 0
|
||||||
|
if (event.pixelDelta.y !== 0) {
|
||||||
|
// Touchpad with pixel precision
|
||||||
|
delta = event.pixelDelta.y * touchpadSpeed
|
||||||
|
} else {
|
||||||
|
// Mouse wheel - larger steps for faster scrolling
|
||||||
|
delta = event.angleDelta.y / 120 * itemHeight * 2.5 // 2.5 items per wheel step
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply momentum for touchpad (smooth continuous scrolling)
|
||||||
|
if (event.pixelDelta.y !== 0 && timeDelta < 50) {
|
||||||
|
momentum = momentum * momentumRetention + delta * 0.15
|
||||||
|
delta += momentum
|
||||||
|
} else {
|
||||||
|
momentum = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply scrolling with proper bounds checking
|
||||||
|
let newY = listView.contentY - delta
|
||||||
|
newY = Math.max(0, Math.min(
|
||||||
|
listView.contentHeight - listView.height, newY))
|
||||||
|
|
||||||
|
// Cancel any conflicting flicks and apply new position
|
||||||
|
if (listView.flicking) {
|
||||||
|
listView.cancelFlick()
|
||||||
|
}
|
||||||
|
|
||||||
|
listView.contentY = newY
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
ScrollBar.vertical: ScrollBar {
|
||||||
policy: ScrollBar.AlwaysOn
|
policy: ScrollBar.AlwaysOn
|
||||||
|
|||||||
@@ -258,14 +258,35 @@ Item {
|
|||||||
model: searchResultsModel
|
model: searchResultsModel
|
||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
interactive: true
|
interactive: true
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
property real momentum: 0
|
||||||
|
onWheel: (event) => {
|
||||||
|
if (event.pixelDelta.y !== 0) {
|
||||||
|
// Touchpad with pixel delta
|
||||||
|
momentum = event.pixelDelta.y * 1.8
|
||||||
|
} else {
|
||||||
|
// Mouse wheel with angle delta
|
||||||
|
momentum = (event.angleDelta.y / 120) * ((36 + parent.spacing) * 2.5) // ~2.5 items per wheel step
|
||||||
|
}
|
||||||
|
|
||||||
|
let newY = parent.contentY - momentum
|
||||||
|
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
|
||||||
|
parent.contentY = newY
|
||||||
|
momentum *= 0.92 // Decay for smooth momentum
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delegate: StyledRect {
|
delegate: StyledRect {
|
||||||
width: searchResultsList.width
|
width: searchResultsList.width
|
||||||
|
|||||||
@@ -102,14 +102,35 @@ Popup {
|
|||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
model: root.allWidgets
|
model: root.allWidgets
|
||||||
|
|
||||||
// Enhanced native kinetic scrolling - faster for both touchpad and mouse
|
// Qt 6.9+ scrolling: flickDeceleration/maximumFlickVelocity only affect touch now
|
||||||
interactive: true
|
interactive: true
|
||||||
flickDeceleration: 1000 // Lower = more momentum, longer scrolling
|
flickDeceleration: 1500
|
||||||
maximumFlickVelocity: 8000 // Higher = faster maximum scroll speed
|
maximumFlickVelocity: 2000
|
||||||
boundsBehavior: Flickable.DragAndOvershootBounds
|
boundsBehavior: Flickable.DragAndOvershootBounds
|
||||||
boundsMovement: Flickable.FollowBoundsBehavior
|
boundsMovement: Flickable.FollowBoundsBehavior
|
||||||
pressDelay: 0
|
pressDelay: 0
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
|
// Custom wheel handler for Qt 6.9+ responsive mouse wheel scrolling
|
||||||
|
WheelHandler {
|
||||||
|
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
|
||||||
|
property real momentum: 0
|
||||||
|
onWheel: (event) => {
|
||||||
|
if (event.pixelDelta.y !== 0) {
|
||||||
|
// Touchpad with pixel delta
|
||||||
|
momentum = event.pixelDelta.y * 1.8
|
||||||
|
} else {
|
||||||
|
// Mouse wheel with angle delta
|
||||||
|
momentum = (event.angleDelta.y / 120) * ((60 + parent.spacing) * 2.5) // ~2.5 items per wheel step
|
||||||
|
}
|
||||||
|
|
||||||
|
let newY = parent.contentY - momentum
|
||||||
|
newY = Math.max(0, Math.min(parent.contentHeight - parent.height, newY))
|
||||||
|
parent.contentY = newY
|
||||||
|
momentum *= 0.92 // Decay for smooth momentum
|
||||||
|
event.accepted = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
width: widgetList.width
|
width: widgetList.width
|
||||||
|
|||||||
Reference in New Issue
Block a user