qml: fix missed clicks while scrolling

This commit is contained in:
selsta committed 2026-11-19 20:21:39 +01:00
1 parent 0051d233c3
commit cb19e0d702
9 files changed
+70 -15

No files matched your search

+4
View File
@@ -509,6 +509,10 @@ Rectangle {
} // Flickable
MoneroComponents.FlickableClickGuard {
flickable: flicker
}
Rectangle {
id: separator
anchors.left: parent.left
+6
View File
@@ -166,6 +166,7 @@ Rectangle {
]
ColumnLayout {
id: viewLayout
anchors.fill: parent
anchors.margins: {
if(currentView === merchantView || currentView === historyView)
@@ -215,6 +216,11 @@ Rectangle {
}// flickable
}
MoneroComponents.FlickableClickGuard {
flickable: mainFlickable
anchors.fill: viewLayout
}
// border
Rectangle {
id: borderLeft
+38
View File
@@ -0,0 +1,38 @@
import QtQuick
// Place above the Flickable so the first press reaches the control under the pointer.
MouseArea {
id: root
required property Flickable flickable
anchors.fill: flickable
enabled: flickable.interactive && flickable.moving
onPressed: (mouse) => {
flickable.cancelFlick();
if (flickable.moving) {
// Qt can retain a trackpad gesture at the edge even after the animation stops.
suspendInteraction.when = true;
suspendInteraction.when = false;
flickable.cancelFlick();
}
mouse.accepted = false;
}
Binding {
id: suspendInteraction
target: root.flickable
property: "interactive"
value: false
when: false
}
// Qt can still report a touchpad gesture in progress after cancelFlick().
// A positive pressDelay lets the Flickable replay that press to its child.
Binding {
target: root.flickable
property: "pressDelay"
value: 1
when: root.enabled
}
}
+4
View File
@@ -169,6 +169,10 @@ Drawer {
palette.dark: "#B8B8BD"
}
}
MoneroComponents.FlickableClickGuard {
flickable: languagesListView
}
}
LanguageModels.LanguageModel {
+5 -1
View File
@@ -123,7 +123,7 @@ Rectangle {
Layout.preferredHeight: 240
Flickable {
id: flickable
id: dialogFlickable
anchors.fill: parent
ScrollBar.vertical: ScrollBar {
onActiveChanged: if (!active && !isMac) active = true
@@ -161,6 +161,10 @@ Rectangle {
}
}
}
MoneroComponents.FlickableClickGuard {
flickable: dialogFlickable
}
}
// Ok/Cancel buttons
+5
View File
@@ -182,6 +182,7 @@ ColumnLayout {
}
Flickable {
id: dropdownFlickable
anchors.fill: parent
contentHeight: columnid.height
interactive: contentHeight > height
@@ -253,6 +254,10 @@ ColumnLayout {
}
}
}
MoneroComponents.FlickableClickGuard {
flickable: dropdownFlickable
}
}
}
}
+2 -7
View File
@@ -414,13 +414,8 @@ Rectangle {
}
}
// Stop scrolling without consuming the first click on a row or control.
MouseArea {
anchors.fill: subaddressAccountListView
onPressed: (mouse) => {
subaddressAccountListView.cancelFlick();
mouse.accepted = false;
}
MoneroComponents.FlickableClickGuard {
flickable: subaddressAccountListView
}
function onPageCompleted() {
+2 -7
View File
@@ -770,13 +770,8 @@ Rectangle {
}
}
// Stop scrolling without consuming the first click on a row or control.
MouseArea {
anchors.fill: subaddressListView
onPressed: (mouse) => {
subaddressListView.cancelFlick();
mouse.accepted = false;
}
MoneroComponents.FlickableClickGuard {
flickable: subaddressListView
}
MessageDialog {
+4
View File
@@ -311,6 +311,10 @@ Rectangle {
}
}
}
MoneroComponents.FlickableClickGuard {
flickable: wizardFlickable
}
}
//Open Wallet from file