mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-18 23:53:41 +02:00
components android focus workaround
This commit is contained in:
parent
b6f268d3a5
commit
f605793cfc
@ -38,6 +38,13 @@ Rectangle {
|
|||||||
property var under: null
|
property var under: null
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
|
function doClick() {
|
||||||
|
// Android workaround
|
||||||
|
releaseFocus();
|
||||||
|
clicked();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function getOffset() {
|
function getOffset() {
|
||||||
var offset = 0
|
var offset = 0
|
||||||
var item = button
|
var item = button
|
||||||
@ -139,7 +146,7 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
if(parent.checked)
|
if(parent.checked)
|
||||||
return
|
return
|
||||||
button.clicked()
|
button.doClick()
|
||||||
parent.checked = true
|
parent.checked = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,12 @@ Item {
|
|||||||
// Dynamic label width
|
// Dynamic label width
|
||||||
Layout.minimumWidth: (label.contentWidth + 10 * scaleRatio) // (label.contentWidth > 80)? label.contentWidth + 20 : 100
|
Layout.minimumWidth: (label.contentWidth + 10 * scaleRatio) // (label.contentWidth > 80)? label.contentWidth + 20 : 100
|
||||||
|
|
||||||
|
function doClick() {
|
||||||
|
// Android workaround
|
||||||
|
releaseFocus();
|
||||||
|
clicked();
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
@ -98,9 +104,9 @@ Item {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
id: buttonArea
|
id: buttonArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: parent.clicked()
|
onClicked: doClick()
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onSpacePressed: clicked()
|
Keys.onSpacePressed: doClick()
|
||||||
Keys.onReturnPressed: clicked()
|
Keys.onReturnPressed: doClick()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user