Transfer: fix focus, cycle focus between Address, Amount and Send

This commit is contained in:
xiphon 2020-12-02 23:55:42 +00:00
parent 96f9c11320
commit 0d5d2dbf5e
4 changed files with 12 additions and 3 deletions

View file

@ -94,6 +94,7 @@ Item {
height: showingHeader ? (inputLabel.height + inputItem.height + 2) : 42 height: showingHeader ? (inputLabel.height + inputItem.height + 2) : 42
onActiveFocusChanged: activeFocus && input.forceActiveFocus()
onTextUpdated: { onTextUpdated: {
// check to remove placeholder text when there is content // check to remove placeholder text when there is content
if(item.isEmpty()){ if(item.isEmpty()){
@ -234,6 +235,7 @@ Item {
anchors.leftMargin: inlineIcon.visible ? 44 : 0 anchors.leftMargin: inlineIcon.visible ? 44 : 0
font.pixelSize: item.fontSize font.pixelSize: item.fontSize
font.bold: item.fontBold font.bold: item.fontBold
KeyNavigation.tab: item.KeyNavigation.tab
onEditingFinished: item.editingFinished() onEditingFinished: item.editingFinished()
onAccepted: item.accepted(); onAccepted: item.accepted();
onTextChanged: item.textUpdated() onTextChanged: item.textUpdated()

View file

@ -94,6 +94,8 @@ ColumnLayout {
signal inputLabelLinkActivated(); signal inputLabelLinkActivated();
signal editingFinished(); signal editingFinished();
onActiveFocusChanged: activeFocus && input.forceActiveFocus()
spacing: 0 spacing: 0
Rectangle { Rectangle {
id: inputLabelRect id: inputLabelRect
@ -159,6 +161,8 @@ ColumnLayout {
id: input id: input
readOnly: false readOnly: false
addressValidation: false addressValidation: false
KeyNavigation.priority: KeyNavigation.BeforeItem
KeyNavigation.tab: item.KeyNavigation.tab
Layout.fillWidth: true Layout.fillWidth: true
leftPadding: item.inputPaddingLeft leftPadding: item.inputPaddingLeft

View file

@ -68,7 +68,7 @@ Item {
id: buttonRect id: buttonRect
anchors.fill: parent anchors.fill: parent
radius: 3 radius: 3
border.width: parent.focus ? 1 : 0 border.width: parent.focus && parent.enabled ? 1 : 0
state: button.enabled ? "active" : "disabled" state: button.enabled ? "active" : "disabled"
Component.onCompleted: state = state Component.onCompleted: state = state
@ -76,7 +76,7 @@ Item {
states: [ states: [
State { State {
name: "hover" name: "hover"
when: buttonArea.containsMouse || button.focus when: button.enabled && (buttonArea.containsMouse || button.focus)
PropertyChanges { PropertyChanges {
target: buttonRect target: buttonRect
color: primary color: primary

View file

@ -170,6 +170,7 @@ Rectangle {
LineEditMulti { LineEditMulti {
id: addressLine id: addressLine
KeyNavigation.tab: amountLine
spacing: 0 spacing: 0
inputPaddingRight: inlineButtonVisible && inlineButton2Visible ? 100 : 60 inputPaddingRight: inlineButtonVisible && inlineButton2Visible ? 100 : 60
fontBold: true fontBold: true
@ -277,6 +278,7 @@ Rectangle {
// Amount input // Amount input
LineEdit { LineEdit {
id: amountLine id: amountLine
KeyNavigation.tab: sendButton
Layout.fillWidth: true Layout.fillWidth: true
inlineIcon: true inlineIcon: true
labelText: "<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\ labelText: "<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\
@ -488,6 +490,7 @@ Rectangle {
RowLayout { RowLayout {
StandardButton { StandardButton {
id: sendButton id: sendButton
KeyNavigation.tab: addressLine
rightIcon: "qrc:///images/rightArrow.png" rightIcon: "qrc:///images/rightArrow.png"
rightIconInactive: "qrc:///images/rightArrowInactive.png" rightIconInactive: "qrc:///images/rightArrowInactive.png"
Layout.topMargin: 4 Layout.topMargin: 4