Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qt6/src/qml/ArrowListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ FocusScope {
P.ArrowListViewButton {
visible: itemsView.interactive
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: width
Layout.fillWidth: true
Layout.preferredHeight: height
view: itemsView
direction: P.ArrowListViewButton.UpButton
Expand Down Expand Up @@ -79,7 +79,7 @@ FocusScope {
P.ArrowListViewButton {
visible: itemsView.interactive
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: width
Layout.fillWidth: true
Layout.preferredHeight: height
view: itemsView
direction: P.ArrowListViewButton.DownButton
Expand Down
41 changes: 37 additions & 4 deletions qt6/src/qml/private/ArrowListViewButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,49 @@ Loader {
property int direction
active: view.interactive

sourceComponent: Button {
flat: true
sourceComponent: ActionButton {
palette.windowText: undefined
enabled: direction === ArrowListViewButton.UpButton ? !view.atYBeginning : !view.atYEnd
width: DS.Style.arrowListView.stepButtonSize.width
height: DS.Style.arrowListView.stepButtonSize.height
icon.name: direction === ArrowListViewButton.UpButton ? DS.Style.arrowListView.upButtonIconName
: DS.Style.arrowListView.downButtonIconName
icon.width: DS.Style.arrowListView.stepButtonIconSize.width
icon.height: DS.Style.arrowListView.stepButtonIconSize.height
onClicked: direction === ArrowListViewButton.UpButton ? view.decrementCurrentIndex()
: view.incrementCurrentIndex()

// Unified scroll operation function
function performScroll() {
direction === ArrowListViewButton.UpButton ? view.decrementCurrentIndex()
: view.incrementCurrentIndex()
}

// Auto-scroll control properties using state machine approach
property bool shouldAutoScroll: hovered && enabled
property bool delayCompleted: false

// Timer for initial delay before starting hover scroll
Timer {
id: initialDelayTimer
interval: 300
repeat: false
running: shouldAutoScroll && !delayCompleted
onTriggered: delayCompleted = true
}

// Timer for continuous hover scrolling
Timer {
id: hoverScrollTimer
interval: 100
repeat: true
running: shouldAutoScroll && delayCompleted
onTriggered: performScroll()
}

// Reset state when auto-scroll should stop
onShouldAutoScrollChanged: {
if (!shouldAutoScroll) {
delayCompleted = false
}
}
}
}
Loading