Browse Source

qml: tap-on-background now removes focus, allowing convenient way to hide keyboard

master
Sander van Grieken 2 years ago
parent
commit
05a34fbe24
  1. 10
      electrum/gui/qml/components/ReceiveDialog.qml
  2. 10
      electrum/gui/qml/components/controls/ElDialog.qml
  3. 12
      electrum/gui/qml/components/wizard/Wizard.qml
  4. 5
      electrum/gui/qml/components/wizard/WizardComponent.qml

10
electrum/gui/qml/components/ReceiveDialog.qml

@ -298,16 +298,6 @@ ElDialog {
}
}
// make clicking the dialog background move the scope away from textedit fields
// so the keyboard goes away
MouseArea {
anchors.fill: parent
z: -1000
onClicked: parkFocus.focus = true
FocusScope { id: parkFocus }
}
RequestDetails {
id: request
wallet: Daemon.currentWallet

10
electrum/gui/qml/components/controls/ElDialog.qml

@ -1,6 +1,7 @@
import QtQuick 2.6
import QtQuick 2.15
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.0
Dialog {
id: abstractdialog
@ -94,4 +95,11 @@ Dialog {
}
}
background: Rectangle {
id: bg
color: Material.dialogColor
TapHandler {
onTapped: bg.forceActiveFocus()
}
}
}

12
electrum/gui/qml/components/wizard/Wizard.qml

@ -1,4 +1,4 @@
import QtQuick 2.6
import QtQuick 2.15
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.1
@ -201,14 +201,4 @@ ElDialog {
}
}
// make clicking the dialog background move the scope away from textedit fields
// so the keyboard goes away
// TODO: here it works on desktop, but not android. hmm.
MouseArea {
anchors.fill: parent
z: -1000
onClicked: { parkFocus.focus = true }
FocusScope { id: parkFocus }
}
}

5
electrum/gui/qml/components/wizard/WizardComponent.qml

@ -1,4 +1,4 @@
import QtQuick 2.0
import QtQuick 2.15
import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.0
@ -18,6 +18,9 @@ Pane {
background: Rectangle {
color: Material.dialogColor
TapHandler {
onTapped: root.forceActiveFocus()
}
}
onAccept: {

Loading…
Cancel
Save