mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-17 00:07:51 +00:00
Merge pull request #3253
110b09ef
TxConfirmationDialog: fix keys handling (xiphon)
This commit is contained in:
commit
2a6ad67f77
1 changed files with 2 additions and 42 deletions
|
@ -45,33 +45,12 @@ Rectangle {
|
||||||
radius: 10
|
radius: 10
|
||||||
border.color: MoneroComponents.Style.blackTheme ? Qt.rgba(255, 255, 255, 0.25) : Qt.rgba(0, 0, 0, 0.25)
|
border.color: MoneroComponents.Style.blackTheme ? Qt.rgba(255, 255, 255, 0.25) : Qt.rgba(0, 0, 0, 0.25)
|
||||||
border.width: 1
|
border.width: 1
|
||||||
focus: true
|
|
||||||
Keys.enabled: true
|
Keys.enabled: true
|
||||||
Keys.onEscapePressed: {
|
Keys.onEscapePressed: {
|
||||||
root.close()
|
root.close()
|
||||||
root.clearFields()
|
root.clearFields()
|
||||||
root.rejected()
|
root.rejected()
|
||||||
}
|
}
|
||||||
Keys.onEnterPressed: {
|
|
||||||
if (root.state == "default") {
|
|
||||||
root.close()
|
|
||||||
root.accepted()
|
|
||||||
} else if (root.state == "error") {
|
|
||||||
root.close()
|
|
||||||
root.clearFields()
|
|
||||||
root.rejected()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Keys.onReturnPressed: {
|
|
||||||
if (root.state == "default") {
|
|
||||||
root.close()
|
|
||||||
root.accepted()
|
|
||||||
} else if (root.state == "error") {
|
|
||||||
root.close()
|
|
||||||
root.clearFields()
|
|
||||||
root.rejected()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
KeyNavigation.tab: confirmButton
|
KeyNavigation.tab: confirmButton
|
||||||
|
|
||||||
property var transactionAmount: ""
|
property var transactionAmount: ""
|
||||||
|
@ -101,7 +80,7 @@ Rectangle {
|
||||||
PropertyChanges { target: bottomMessage; visible: false }
|
PropertyChanges { target: bottomMessage; visible: false }
|
||||||
PropertyChanges { target: buttons; visible: true }
|
PropertyChanges { target: buttons; visible: true }
|
||||||
PropertyChanges { target: backButton; visible: true; primary: false }
|
PropertyChanges { target: backButton; visible: true; primary: false }
|
||||||
PropertyChanges { target: confirmButton; visible: true }
|
PropertyChanges { target: confirmButton; visible: true; focus: true }
|
||||||
}, State {
|
}, State {
|
||||||
// error message being displayed, show only back button
|
// error message being displayed, show only back button
|
||||||
name: "error";
|
name: "error";
|
||||||
|
@ -115,7 +94,7 @@ Rectangle {
|
||||||
PropertyChanges { target: bottom; visible: true }
|
PropertyChanges { target: bottom; visible: true }
|
||||||
PropertyChanges { target: bottomMessage; visible: false }
|
PropertyChanges { target: bottomMessage; visible: false }
|
||||||
PropertyChanges { target: buttons; visible: true }
|
PropertyChanges { target: buttons; visible: true }
|
||||||
PropertyChanges { target: backButton; visible: true; primary: true }
|
PropertyChanges { target: backButton; visible: true; primary: true; focus: true }
|
||||||
PropertyChanges { target: confirmButton; visible: false }
|
PropertyChanges { target: confirmButton; visible: false }
|
||||||
}, State {
|
}, State {
|
||||||
// creating or sending transaction, show tx details and don't show any button
|
// creating or sending transaction, show tx details and don't show any button
|
||||||
|
@ -141,7 +120,6 @@ Rectangle {
|
||||||
|
|
||||||
//clean previous error message
|
//clean previous error message
|
||||||
errorText.text = "";
|
errorText.text = "";
|
||||||
root.forceActiveFocus()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
|
@ -422,17 +400,8 @@ Rectangle {
|
||||||
id: backButton
|
id: backButton
|
||||||
text: qsTr("Back") + translationManager.emptyString;
|
text: qsTr("Back") + translationManager.emptyString;
|
||||||
width: 200
|
width: 200
|
||||||
focus: false
|
|
||||||
primary: false
|
primary: false
|
||||||
KeyNavigation.tab: confirmButton
|
KeyNavigation.tab: confirmButton
|
||||||
Keys.enabled: backButton.visible
|
|
||||||
Keys.onReturnPressed: backButton.onClicked
|
|
||||||
Keys.onEnterPressed: backButton.onClicked
|
|
||||||
Keys.onEscapePressed: {
|
|
||||||
root.close()
|
|
||||||
root.clearFields()
|
|
||||||
root.rejected()
|
|
||||||
}
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.close()
|
root.close()
|
||||||
root.clearFields()
|
root.clearFields()
|
||||||
|
@ -445,16 +414,7 @@ Rectangle {
|
||||||
text: qsTr("Confirm") + translationManager.emptyString;
|
text: qsTr("Confirm") + translationManager.emptyString;
|
||||||
rightIcon: "qrc:///images/rightArrow.png"
|
rightIcon: "qrc:///images/rightArrow.png"
|
||||||
width: 200
|
width: 200
|
||||||
focus: false
|
|
||||||
KeyNavigation.tab: backButton
|
KeyNavigation.tab: backButton
|
||||||
Keys.enabled: confirmButton.visible
|
|
||||||
Keys.onReturnPressed: confirmButton.onClicked
|
|
||||||
Keys.onEnterPressed: confirmButton.onClicked
|
|
||||||
Keys.onEscapePressed: {
|
|
||||||
root.close()
|
|
||||||
root.clearFields()
|
|
||||||
root.rejected()
|
|
||||||
}
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.close()
|
root.close()
|
||||||
root.accepted()
|
root.accepted()
|
||||||
|
|
Loading…
Reference in a new issue