aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-11-02 16:26:07 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-11-02 16:26:07 +0300
commit550087f4a14df7e5b4ff6592be9e9cd64162b801 (patch)
tree815b9acad586f0bd4c8fe0ff665f5d9d8de12ee9
parent513f7ebc3aad72215a65568891487ea6198b6f0f (diff)
downloadmonzero-gui-550087f4a14df7e5b4ff6592be9e9cd64162b801.tar.gz
monzero-gui-550087f4a14df7e5b4ff6592be9e9cd64162b801.tar.xz
monzero-gui-550087f4a14df7e5b4ff6592be9e9cd64162b801.zip
PasswordDialog: accept/reject with Enter/Esc, Tab navigation
-rw-r--r--components/PasswordDialog.qml26
1 files changed, 20 insertions, 6 deletions
diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml
index c93a94ec..79765f7d 100644
--- a/components/PasswordDialog.qml
+++ b/components/PasswordDialog.qml
@@ -77,7 +77,7 @@ Window {
TextField {
id : passwordInput
- focus:true
+ focus: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: TextInput.AlignHCenter
@@ -85,6 +85,8 @@ Window {
font.family: "Arial"
font.pixelSize: 32
echoMode: TextInput.Password
+ KeyNavigation.tab: okButton
+
style: TextFieldStyle {
renderType: Text.NativeRendering
textColor: "#35B05A"
@@ -95,6 +97,16 @@ Window {
border.width: 0
}
}
+ Keys.onReturnPressed: {
+ root.accepted()
+ root.close()
+ }
+
+ Keys.onEscapePressed: {
+ root.rejected()
+ root.close()
+ }
+
}
// underline
@@ -130,10 +142,10 @@ Window {
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
text: qsTr("Ok")
-
+ KeyNavigation.tab: cancelButton
onClicked: {
- accepted()
- close()
+ root.accepted()
+ root.close()
}
}
@@ -146,13 +158,15 @@ Window {
releasedColor: "#FF6C3C"
pressedColor: "#FF4304"
text: qsTr("Cancel")
+ KeyNavigation.tab: passwordInput
onClicked: {
- rejected()
- close()
+ root.rejected()
+ root.close()
}
}
}
}
+
}