diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-03-27 11:06:26 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-27 12:31:02 -0700 |
commit | ebbe01a359f82c8c1b4f9f30a7d4e744b3e180d9 (patch) | |
tree | 45e97f2d6591d2df52a59bdd6ff489c21858faa8 | |
parent | 60d2d051bbcc3f4abad9ea1bcb14c19092d79d97 (diff) | |
download | subsurface-ebbe01a359f82c8c1b4f9f30a7d4e744b3e180d9.tar.gz |
mobile UI: disable action button / drawer interactions
This is a feature that I never fully understood, but that apparently is
causing the drawers to show up for people who are just trying to
interact with the action button. The approach here is really drastic and
crude, but in my testing it seems to work.
Reported-by: Hartley Horwitz <hhrwtz@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | scripts/kirigami.diff | 89 |
1 files changed, 87 insertions, 2 deletions
diff --git a/scripts/kirigami.diff b/scripts/kirigami.diff index 785dd974d..1f8889275 100644 --- a/scripts/kirigami.diff +++ b/scripts/kirigami.diff @@ -204,15 +204,100 @@ diff -rwu ../kirigami/src/kirigamiplugin.cpp ./src/kirigamiplugin.cpp diff -rwu ../kirigami/src/controls/private/ActionButton.qml ./src/controls/private/ActionButton.qml --- ../kirigami/src/controls/private/ActionButton.qml 2019-10-11 14:00:51.783839545 -0400 +++ ./src/controls/private/ActionButton.qml 2019-10-27 17:12:04.339302719 -0400 -@@ -70,7 +70,7 @@ +@@ -70,12 +70,12 @@ anchors.bottom: edgeMouseArea.bottom - implicitWidth: implicitHeight + Units.iconSizes.smallMedium*2 + Units.gridUnit -+ implicitWidth: implicitHeight + Units.iconSizes.smallMedium*4 + Units.gridUnit ++ implicitWidth: implicitHeight + Units.iconSizes.smallMedium*4 + Units.gridUnit implicitHeight: Units.iconSizes.medium + Units.largeSpacing * 2 + onXChanged: { +- if (mouseArea.pressed || edgeMouseArea.pressed || fakeContextMenuButton.pressed) { ++ if (0 && (mouseArea.pressed || edgeMouseArea.pressed || fakeContextMenuButton.pressed)) { + if (root.hasGlobalDrawer && globalDrawer.enabled && globalDrawer.modal) { + globalDrawer.peeking = true; + globalDrawer.visible = true; +@@ -97,13 +97,13 @@ + property bool internalVisibility: (!root.hasApplicationWindow || (applicationWindow().controlsVisible && applicationWindow().height > root.height*2)) && (root.action === null || root.action.visible === undefined || root.action.visible) + preventStealing: true + +- drag { +- target: button +- //filterChildren: true +- axis: Drag.XAxis +- minimumX: root.hasContextDrawer && contextDrawer.enabled && contextDrawer.modal ? 0 : root.width/2 - button.width/2 +- maximumX: root.hasGlobalDrawer && globalDrawer.enabled && globalDrawer.modal ? root.width : root.width/2 - button.width/2 +- } ++// drag { ++// target: button ++// //filterChildren: true ++// axis: Drag.XAxis ++// minimumX: root.hasContextDrawer && contextDrawer.enabled && contextDrawer.modal ? 0 : root.width/2 - button.width/2 ++// maximumX: root.hasGlobalDrawer && globalDrawer.enabled && globalDrawer.modal ? root.width : root.width/2 - button.width/2 ++// } + + property var downTimestamp; + property int startX +@@ -147,24 +147,24 @@ + drawerShowAdjust = 0; + + //project where it would be a full second in the future +- if (root.hasContextDrawer && root.hasGlobalDrawer && globalDrawer.modal && x + speed > Math.min(root.width/4*3, root.width/2 + globalDrawer.contentItem.width/2)) { +- globalDrawer.open(); +- contextDrawer.close(); +- } else if (root.hasContextDrawer && x + speed < Math.max(root.width/4, root.width/2 - contextDrawer.contentItem.width/2)) { +- if (root.hasContextDrawer && contextDrawer.modal) { +- contextDrawer.open(); +- } +- if (root.hasGlobalDrawer && globalDrawer.modal) { +- globalDrawer.close(); +- } +- } else { +- if (root.hasGlobalDrawer && globalDrawer.modal) { +- globalDrawer.close(); +- } +- if (root.hasContextDrawer && contextDrawer.modal) { +- contextDrawer.close(); +- } +- } ++// if (root.hasContextDrawer && root.hasGlobalDrawer && globalDrawer.modal && x + speed > Math.min(root.width/4*3, root.width/2 + globalDrawer.contentItem.width/2)) { ++// globalDrawer.open(); ++// contextDrawer.close(); ++// } else if (root.hasContextDrawer && x + speed < Math.max(root.width/4, root.width/2 - contextDrawer.contentItem.width/2)) { ++// if (root.hasContextDrawer && contextDrawer.modal) { ++// contextDrawer.open(); ++// } ++// if (root.hasGlobalDrawer && globalDrawer.modal) { ++// globalDrawer.close(); ++// } ++// } else { ++// if (root.hasGlobalDrawer && globalDrawer.modal) { ++// globalDrawer.close(); ++// } ++// if (root.hasContextDrawer && contextDrawer.modal) { ++// contextDrawer.close(); ++// } ++// } + //Don't rely on native onClicked, but fake it here: + //Qt.startDragDistance is not adapted to devices dpi in case + //of Android, so consider the button "clicked" when: +@@ -201,10 +201,10 @@ + } + } + +- onPositionChanged: { +- drawerShowAdjust = Math.min(0.3, Math.max(0, (startMouseY - mouse.y)/(Units.gridUnit*15))); +- button.xChanged(); +- } ++// onPositionChanged: { ++// drawerShowAdjust = Math.min(0.3, Math.max(0, (startMouseY - mouse.y)/(Units.gridUnit*15))); ++// button.xChanged(); ++// } + onPressAndHold: { + if (!actionUnderMouse) { + return; @@ -291,7 +291,7 @@ bottomMargin: Units.smallSpacing } |