This commit is contained in:
ItsLemmy
2025-11-30 14:36:23 -05:00
parent 5d3c91f3ad
commit b6c1f6e90a
2 changed files with 9 additions and 9 deletions

View File

@@ -120,7 +120,7 @@ RowLayout {
width: ListView.view ? ListView.view.width : (parentComboBox ? parentComboBox.width - Style.marginM * 3 : 0) width: ListView.view ? ListView.view.width : (parentComboBox ? parentComboBox.width - Style.marginM * 3 : 0)
hoverEnabled: true hoverEnabled: true
highlighted: ListView.view.currentIndex === itemIndex highlighted: ListView.view.currentIndex === itemIndex
property bool pendingClick: false property bool pendingClick: false
Timer { Timer {
id: clickRetryTimer id: clickRetryTimer

View File

@@ -112,37 +112,37 @@ Item {
ListView { ListView {
id: listView id: listView
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: root.verticalScrollBarActive ? root.handleWidth + 4 : 0 anchors.rightMargin: root.verticalScrollBarActive ? root.handleWidth + 4 : 0
clip: true clip: true
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
flickDeceleration: 1500 flickDeceleration: 1500
Timer { Timer {
id: scrollbarActiveTimer id: scrollbarActiveTimer
interval: 150 interval: 150
repeat: false repeat: false
} }
WheelHandler { WheelHandler {
id: wheelHandler id: wheelHandler
target: listView target: listView
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: function(event) { onWheel: function (event) {
if (listView.flicking || listView.moving) { if (listView.flicking || listView.moving) {
listView.cancelFlick(); listView.cancelFlick();
} }
var delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y : (event.angleDelta.y / 8); var delta = event.pixelDelta.y !== 0 ? event.pixelDelta.y : (event.angleDelta.y / 8);
var newContentY = listView.contentY - delta; var newContentY = listView.contentY - delta;
newContentY = Math.max(0, Math.min(newContentY, listView.contentHeight - listView.height)); newContentY = Math.max(0, Math.min(newContentY, listView.contentHeight - listView.height));
listView.contentY = newContentY; listView.contentY = newContentY;
if (listView.ScrollBar.vertical) { if (listView.ScrollBar.vertical) {
listView.ScrollBar.vertical.active = true; listView.ScrollBar.vertical.active = true;
} }
scrollbarActiveTimer.restart(); scrollbarActiveTimer.restart();
event.accepted = true; event.accepted = true;
} }