qml: styling ImportAddressesKeysDialog
This commit is contained in:
@@ -9,6 +9,10 @@ import "controls"
|
|||||||
ElDialog {
|
ElDialog {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
title: Daemon.currentWallet.isWatchOnly
|
||||||
|
? qsTr('Import additional addresses')
|
||||||
|
: qsTr('Import additional keys')
|
||||||
|
|
||||||
property bool valid: false
|
property bool valid: false
|
||||||
|
|
||||||
modal: true
|
modal: true
|
||||||
@@ -16,12 +20,11 @@ ElDialog {
|
|||||||
Overlay.modal: Rectangle {
|
Overlay.modal: Rectangle {
|
||||||
color: "#aa000000"
|
color: "#aa000000"
|
||||||
}
|
}
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
||||||
title: Daemon.currentWallet.isWatchOnly
|
padding: 0
|
||||||
? qsTr('Import additional addresses')
|
|
||||||
: qsTr('Import additional keys')
|
|
||||||
|
|
||||||
function verify(text) {
|
function verify(text) {
|
||||||
if (Daemon.currentWallet.isWatchOnly)
|
if (Daemon.currentWallet.isWatchOnly)
|
||||||
@@ -38,61 +41,68 @@ ElDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
width: parent.width
|
anchors.fill: parent
|
||||||
height: parent.height
|
spacing: 0
|
||||||
|
|
||||||
Label {
|
ColumnLayout {
|
||||||
text: Daemon.currentWallet.isWatchOnly
|
Layout.fillWidth: true
|
||||||
? qsTr('Import additional addresses')
|
Layout.fillHeight: true
|
||||||
: qsTr('Import additional keys')
|
Layout.leftMargin: constants.paddingLarge
|
||||||
}
|
Layout.rightMargin: constants.paddingLarge
|
||||||
|
|
||||||
RowLayout {
|
Label {
|
||||||
TextArea {
|
text: Daemon.currentWallet.isWatchOnly
|
||||||
id: import_ta
|
? qsTr('Import additional addresses')
|
||||||
Layout.fillWidth: true
|
: qsTr('Import additional keys')
|
||||||
Layout.minimumHeight: 80
|
|
||||||
focus: true
|
|
||||||
wrapMode: TextEdit.WrapAnywhere
|
|
||||||
onTextChanged: valid = verify(text)
|
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
|
||||||
Layout.alignment: Qt.AlignTop
|
RowLayout {
|
||||||
ToolButton {
|
TextArea {
|
||||||
icon.source: '../../icons/paste.png'
|
id: import_ta
|
||||||
icon.height: constants.iconSizeMedium
|
Layout.fillWidth: true
|
||||||
icon.width: constants.iconSizeMedium
|
Layout.minimumHeight: 80
|
||||||
onClicked: {
|
focus: true
|
||||||
if (verify(AppController.clipboardToText())) {
|
wrapMode: TextEdit.WrapAnywhere
|
||||||
if (import_ta.text != '')
|
onTextChanged: valid = verify(text)
|
||||||
import_ta.text = import_ta.text + '\n'
|
}
|
||||||
import_ta.text = import_ta.text + AppController.clipboardToText()
|
ColumnLayout {
|
||||||
|
Layout.alignment: Qt.AlignTop
|
||||||
|
ToolButton {
|
||||||
|
icon.source: '../../icons/paste.png'
|
||||||
|
icon.height: constants.iconSizeMedium
|
||||||
|
icon.width: constants.iconSizeMedium
|
||||||
|
onClicked: {
|
||||||
|
if (verify(AppController.clipboardToText())) {
|
||||||
|
if (import_ta.text != '')
|
||||||
|
import_ta.text = import_ta.text + '\n'
|
||||||
|
import_ta.text = import_ta.text + AppController.clipboardToText()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ToolButton {
|
||||||
|
icon.source: '../../icons/qrcode.png'
|
||||||
|
icon.height: constants.iconSizeMedium
|
||||||
|
icon.width: constants.iconSizeMedium
|
||||||
|
scale: 1.2
|
||||||
|
onClicked: {
|
||||||
|
var scan = qrscan.createObject(root.contentItem) // can't use dialog as parent?
|
||||||
|
scan.onFound.connect(function() {
|
||||||
|
if (verify(scan.scanData)) {
|
||||||
|
if (import_ta.text != '')
|
||||||
|
import_ta.text = import_ta.text + ',\n'
|
||||||
|
import_ta.text = import_ta.text + scan.scanData
|
||||||
|
}
|
||||||
|
scan.destroy()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ToolButton {
|
|
||||||
icon.source: '../../icons/qrcode.png'
|
|
||||||
icon.height: constants.iconSizeMedium
|
|
||||||
icon.width: constants.iconSizeMedium
|
|
||||||
scale: 1.2
|
|
||||||
onClicked: {
|
|
||||||
var scan = qrscan.createObject(root.contentItem) // can't use dialog as parent?
|
|
||||||
scan.onFound.connect(function() {
|
|
||||||
if (verify(scan.scanData)) {
|
|
||||||
if (import_ta.text != '')
|
|
||||||
import_ta.text = import_ta.text + ',\n'
|
|
||||||
import_ta.text = import_ta.text + scan.scanData
|
|
||||||
}
|
|
||||||
scan.destroy()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.preferredWidth: 1
|
Layout.preferredWidth: 1
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FlatButton {
|
FlatButton {
|
||||||
|
|||||||
Reference in New Issue
Block a user