diff options
| author | Jaquee <jaquee.monero@gmail.com> | 2017-08-08 10:37:52 +0200 |
|---|---|---|
| committer | Jaquee <jaquee.monero@gmail.com> | 2017-11-03 16:57:11 +0100 |
| commit | f605793cfcd15298579b08580fb37458a2c0e001 (patch) | |
| tree | cd31164ae52915279c8333e71f1842b0f7a3f4bd /components | |
| parent | b6f268d3a553a82565bac9c351d1b6cc75c46ab3 (diff) | |
| download | monzero-gui-f605793cfcd15298579b08580fb37458a2c0e001.tar.gz monzero-gui-f605793cfcd15298579b08580fb37458a2c0e001.tar.xz monzero-gui-f605793cfcd15298579b08580fb37458a2c0e001.zip | |
components android focus workaround
Diffstat (limited to 'components')
| -rw-r--r-- | components/MenuButton.qml | 9 | ||||
| -rw-r--r-- | components/StandardButton.qml | 12 |
2 files changed, 17 insertions, 4 deletions
diff --git a/components/MenuButton.qml b/components/MenuButton.qml index 0e33057c..23ab4f74 100644 --- a/components/MenuButton.qml +++ b/components/MenuButton.qml @@ -38,6 +38,13 @@ Rectangle { property var under: null signal clicked() + function doClick() { + // Android workaround + releaseFocus(); + clicked(); + } + + function getOffset() { var offset = 0 var item = button @@ -139,7 +146,7 @@ Rectangle { onClicked: { if(parent.checked) return - button.clicked() + button.doClick() parent.checked = true } } diff --git a/components/StandardButton.qml b/components/StandardButton.qml index c55ebb12..3954c58c 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -45,6 +45,12 @@ Item { // Dynamic label width Layout.minimumWidth: (label.contentWidth + 10 * scaleRatio) // (label.contentWidth > 80)? label.contentWidth + 20 : 100 + function doClick() { + // Android workaround + releaseFocus(); + clicked(); + } + Rectangle { anchors.left: parent.left anchors.right: parent.right @@ -98,9 +104,9 @@ Item { MouseArea { id: buttonArea anchors.fill: parent - onClicked: parent.clicked() + onClicked: doClick() } - Keys.onSpacePressed: clicked() - Keys.onReturnPressed: clicked() + Keys.onSpacePressed: doClick() + Keys.onReturnPressed: doClick() } |
