mirror of
https://github.com/monero-project/monero-gui.git
synced 2026-04-02 18:07:25 -04:00
PasswordDialog: accept/reject with Enter/Esc, Tab navigation
This commit is contained in:
@@ -77,7 +77,7 @@ Window {
|
|||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id : passwordInput
|
id : passwordInput
|
||||||
focus:true
|
focus: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
horizontalAlignment: TextInput.AlignHCenter
|
horizontalAlignment: TextInput.AlignHCenter
|
||||||
@@ -85,6 +85,8 @@ Window {
|
|||||||
font.family: "Arial"
|
font.family: "Arial"
|
||||||
font.pixelSize: 32
|
font.pixelSize: 32
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
|
KeyNavigation.tab: okButton
|
||||||
|
|
||||||
style: TextFieldStyle {
|
style: TextFieldStyle {
|
||||||
renderType: Text.NativeRendering
|
renderType: Text.NativeRendering
|
||||||
textColor: "#35B05A"
|
textColor: "#35B05A"
|
||||||
@@ -95,6 +97,16 @@ Window {
|
|||||||
border.width: 0
|
border.width: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Keys.onReturnPressed: {
|
||||||
|
root.accepted()
|
||||||
|
root.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onEscapePressed: {
|
||||||
|
root.rejected()
|
||||||
|
root.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// underline
|
// underline
|
||||||
@@ -130,10 +142,10 @@ Window {
|
|||||||
releasedColor: "#FF6C3C"
|
releasedColor: "#FF6C3C"
|
||||||
pressedColor: "#FF4304"
|
pressedColor: "#FF4304"
|
||||||
text: qsTr("Ok")
|
text: qsTr("Ok")
|
||||||
|
KeyNavigation.tab: cancelButton
|
||||||
onClicked: {
|
onClicked: {
|
||||||
accepted()
|
root.accepted()
|
||||||
close()
|
root.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,13 +158,15 @@ Window {
|
|||||||
releasedColor: "#FF6C3C"
|
releasedColor: "#FF6C3C"
|
||||||
pressedColor: "#FF4304"
|
pressedColor: "#FF4304"
|
||||||
text: qsTr("Cancel")
|
text: qsTr("Cancel")
|
||||||
|
KeyNavigation.tab: passwordInput
|
||||||
onClicked: {
|
onClicked: {
|
||||||
rejected()
|
root.rejected()
|
||||||
close()
|
root.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user