Browse Source

qml: styling OpenWalletDialog

master
Sander van Grieken 3 years ago
parent
commit
32d60be90a
  1. 36
      electrum/gui/qml/components/OpenWalletDialog.qml

36
electrum/gui/qml/components/OpenWalletDialog.qml

@ -10,8 +10,9 @@ import "controls"
ElDialog { ElDialog {
id: openwalletdialog id: openwalletdialog
width: parent.width width: parent.width * 4/5
height: parent.height
anchors.centerIn: parent
title: qsTr("Open Wallet") title: qsTr("Open Wallet")
iconSource: '../../../icons/wallet.png' iconSource: '../../../icons/wallet.png'
@ -32,6 +33,7 @@ ElDialog {
property bool _unlockClicked: false property bool _unlockClicked: false
ColumnLayout { ColumnLayout {
id: rootLayout
width: parent.width width: parent.width
spacing: constants.paddingLarge spacing: constants.paddingLarge
@ -78,18 +80,17 @@ ElDialog {
} }
Label { Label {
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: !wallet_db.validPassword && _unlockClicked ? qsTr("Invalid Password") : '' text: !wallet_db.validPassword && _unlockClicked ? qsTr("Invalid Password") : ''
color: constants.colorError color: constants.colorError
font.pixelSize: constants.fontSizeLarge font.pixelSize: constants.fontSizeLarge
} }
Button { FlatButton {
id: unlockButton id: unlockButton
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
visible: wallet_db.needsPassword visible: wallet_db.needsPassword
icon.source: '../../icons/unlock.png'
text: qsTr("Unlock") text: qsTr("Unlock")
onClicked: { onClicked: {
unlock() unlock()
@ -97,33 +98,19 @@ ElDialog {
} }
Label { Label {
text: qsTr('Select HW device') Layout.alignment: Qt.AlignHCenter
visible: wallet_db.needsHWDevice
}
ComboBox {
id: hw_device
model: ['','Not implemented']
visible: wallet_db.needsHWDevice
}
Label {
text: qsTr('Wallet requires splitting')
visible: wallet_db.requiresSplit visible: wallet_db.requiresSplit
text: qsTr('Wallet requires splitting')
font.pixelSize: constants.fontSizeLarge
} }
Button { FlatButton {
Layout.alignment: Qt.AlignHCenter
visible: wallet_db.requiresSplit visible: wallet_db.requiresSplit
text: qsTr('Split wallet') text: qsTr('Split wallet')
onClicked: wallet_db.doSplit() onClicked: wallet_db.doSplit()
} }
BusyIndicator {
id: busy
running: false
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
}
} }
function unlock() { function unlock() {
@ -143,7 +130,6 @@ ElDialog {
} }
onReadyChanged: { onReadyChanged: {
if (ready) { if (ready) {
busy.running = true
Daemon.load_wallet(openwalletdialog.path, password.text) Daemon.load_wallet(openwalletdialog.path, password.text)
openwalletdialog.close() openwalletdialog.close()
} }

Loading…
Cancel
Save