mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-12-04 00:38:09 +00:00
qml: fix missed clicks while scrolling
This commit is contained in:
9 files changed
+70
-15
No files matched your search
@@ -509,6 +509,10 @@ Rectangle {
|
||||
|
||||
} // Flickable
|
||||
|
||||
MoneroComponents.FlickableClickGuard {
|
||||
flickable: flicker
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: separator
|
||||
anchors.left: parent.left
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -169,6 +169,10 @@ Drawer {
|
||||
palette.dark: "#B8B8BD"
|
||||
}
|
||||
}
|
||||
|
||||
MoneroComponents.FlickableClickGuard {
|
||||
flickable: languagesListView
|
||||
}
|
||||
}
|
||||
|
||||
LanguageModels.LanguageModel {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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 {
|
||||
|
||||
@@ -311,6 +311,10 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MoneroComponents.FlickableClickGuard {
|
||||
flickable: wizardFlickable
|
||||
}
|
||||
}
|
||||
|
||||
//Open Wallet from file
|
||||
|
||||
Reference in new issue
Block a user