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 string text
property bool readOnly: false property bool readOnly: false
property alias placeholderText: seedtextarea.placeholderText property alias placeholderText: seedtextarea.placeholderText
property string indicatorText
property bool indicatorValid
property var _suggestions: [] property var _suggestions: []
@ -60,6 +62,23 @@ Pane {
// TODO: cursorPosition only on suggestion apply // TODO: cursorPosition only on suggestion apply
cursorPosition = text.length 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 { Flickable {

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

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

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

@ -163,6 +163,7 @@ WizardComponent {
id: infotext id: infotext
Layout.fillWidth: true Layout.fillWidth: true
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.bottomMargin: constants.paddingLarge
} }
SeedTextArea { SeedTextArea {
@ -172,25 +173,11 @@ WizardComponent {
placeholderText: cosigner ? qsTr('Enter cosigner seed') : qsTr('Enter your seed') placeholderText: cosigner ? qsTr('Enter cosigner seed') : qsTr('Enter your seed')
indicatorValid: root.valid
onTextChanged: { onTextChanged: {
startValidationTimer() 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 { TextArea {
id: validationtext id: validationtext
@ -222,13 +209,13 @@ WizardComponent {
Bitcoin { Bitcoin {
id: bitcoin id: bitcoin
onSeedTypeChanged: contentText.text = bitcoin.seedType onSeedTypeChanged: seedtext.indicatorText = bitcoin.seedType
onValidationMessageChanged: validationtext.text = validationMessage onValidationMessageChanged: validationtext.text = validationMessage
} }
function startValidationTimer() { function startValidationTimer() {
valid = false valid = false
contentText.text = '' seedtext.indicatorText = ''
validationTimer.restart() validationTimer.restart()
} }

Loading…
Cancel
Save