Browse Source

qml: styling seedtextarea

master
Sander van Grieken 3 years ago
parent
commit
8cd26820bf
  1. 19
      electrum/gui/qml/components/controls/SeedTextArea.qml
  2. 2
      electrum/gui/qml/components/wizard/WCConfirmSeed.qml
  3. 23
      electrum/gui/qml/components/wizard/WCHaveSeed.qml

19
electrum/gui/qml/components/controls/SeedTextArea.qml

@ -13,6 +13,8 @@ Pane {
property string text
property bool readOnly: false
property alias placeholderText: seedtextarea.placeholderText
property string indicatorText
property bool indicatorValid
property var _suggestions: []
@ -60,6 +62,23 @@ Pane {
// TODO: cursorPosition only on suggestion apply
cursorPosition = text.length
}
Rectangle {
anchors.fill: contentText
color: root.indicatorValid ? 'green' : 'red'
border.color: Material.accentColor
radius: 2
}
Label {
id: contentText
text: root.indicatorText
anchors.right: parent.right
anchors.bottom: parent.bottom
leftPadding: root.indicatorText != '' ? constants.paddingLarge : 0
rightPadding: root.indicatorText != '' ? constants.paddingLarge : 0
font.bold: false
font.pixelSize: constants.fontSizeSmall
}
}
Flickable {

2
electrum/gui/qml/components/wizard/WCConfirmSeed.qml

@ -28,13 +28,13 @@ WizardComponent {
InfoTextArea {
Layout.fillWidth: true
Layout.bottomMargin: constants.paddingLarge
text: qsTr('Your seed is important!') + ' ' +
qsTr('If you lose your seed, your money will be permanently lost.') + ' ' +
qsTr('To make sure that you have properly saved your seed, please retype it here.')
}
Label {
Layout.topMargin: constants.paddingMedium
text: qsTr('Confirm your seed (re-enter)')
}

23
electrum/gui/qml/components/wizard/WCHaveSeed.qml

@ -163,6 +163,7 @@ WizardComponent {
id: infotext
Layout.fillWidth: true
Layout.columnSpan: 2
Layout.bottomMargin: constants.paddingLarge
}
SeedTextArea {
@ -172,25 +173,11 @@ WizardComponent {
placeholderText: cosigner ? qsTr('Enter cosigner seed') : qsTr('Enter your seed')
indicatorValid: root.valid
onTextChanged: {
startValidationTimer()
}
Rectangle {
anchors.fill: contentText
color: root.valid ? 'green' : 'red'
border.color: Material.accentColor
radius: 2
}
Label {
id: contentText
anchors.right: parent.right
anchors.bottom: parent.bottom
leftPadding: text != '' ? constants.paddingLarge : 0
rightPadding: text != '' ? constants.paddingLarge : 0
font.bold: false
font.pixelSize: constants.fontSizeSmall
}
}
TextArea {
id: validationtext
@ -222,13 +209,13 @@ WizardComponent {
Bitcoin {
id: bitcoin
onSeedTypeChanged: contentText.text = bitcoin.seedType
onSeedTypeChanged: seedtext.indicatorText = bitcoin.seedType
onValidationMessageChanged: validationtext.text = validationMessage
}
function startValidationTimer() {
valid = false
contentText.text = ''
seedtext.indicatorText = ''
validationTimer.restart()
}

Loading…
Cancel
Save