Browse Source

qml: ui

patch-4
Sander van Grieken 2 years ago
parent
commit
c7cdd42665
  1. 18
      electrum/gui/qml/components/AddressDetails.qml
  2. 320
      electrum/gui/qml/components/ConfirmTxDialog.qml
  3. 38
      electrum/gui/qml/components/GenericShareDialog.qml
  4. 454
      electrum/gui/qml/components/InvoiceDialog.qml
  5. 36
      electrum/gui/qml/components/PasswordDialog.qml
  6. 3
      electrum/gui/qml/components/SendDialog.qml
  7. 77
      electrum/gui/qml/components/controls/InfoTextArea.qml

18
electrum/gui/qml/components/AddressDetails.qml

@ -24,7 +24,6 @@ Pane {
icon.color: 'transparent' icon.color: 'transparent'
action: Action { action: Action {
text: qsTr('Spend from') text: qsTr('Spend from')
//onTriggered:
icon.source: '../../icons/tab_send.png' icon.source: '../../icons/tab_send.png'
enabled: false enabled: false
} }
@ -45,6 +44,14 @@ Pane {
enabled: false enabled: false
} }
} }
MenuItem {
icon.color: 'transparent'
action: Action {
text: addressdetails.isFrozen ? qsTr('Unfreeze') : qsTr('Freeze')
onTriggered: addressdetails.freeze(!addressdetails.isFrozen)
icon.source: '../../icons/seal.png'
}
}
} }
Flickable { Flickable {
@ -245,15 +252,6 @@ Pane {
Label { Label {
text: addressdetails.isFrozen ? qsTr('Frozen') : qsTr('Not frozen') text: addressdetails.isFrozen ? qsTr('Frozen') : qsTr('Not frozen')
} }
ColumnLayout {
Layout.columnSpan: 2
Button {
text: addressdetails.isFrozen ? qsTr('Unfreeze') : qsTr('Freeze')
onClicked: addressdetails.freeze(!addressdetails.isFrozen)
}
}
} }
} }

320
electrum/gui/qml/components/ConfirmTxDialog.qml

@ -28,6 +28,9 @@ ElDialog {
width: parent.width width: parent.width
height: parent.height height: parent.height
padding: 0
standardButtons: Dialog.Cancel
modal: true modal: true
parent: Overlay.overlay parent: Overlay.overlay
@ -42,220 +45,201 @@ ElDialog {
: '' : ''
} }
GridLayout { ColumnLayout {
id: layout
width: parent.width width: parent.width
height: parent.height height: parent.height
columns: 2 spacing: 0
Rectangle { GridLayout {
height: 1 width: parent.width
Layout.fillWidth: true columns: 2
Layout.columnSpan: 2 Layout.leftMargin: constants.paddingLarge
color: Material.accentColor Layout.rightMargin: constants.paddingLarge
}
Label {
id: amountLabel
text: qsTr('Amount to send')
}
RowLayout {
Layout.fillWidth: true
Label {
id: btcValue
font.bold: true
}
Label { Label {
text: Config.baseUnit id: amountLabel
text: qsTr('Amount to send')
color: Material.accentColor color: Material.accentColor
} }
Label { RowLayout {
id: fiatValue
Layout.fillWidth: true Layout.fillWidth: true
font.pixelSize: constants.fontSizeMedium Label {
} id: btcValue
font.bold: true
}
Component.onCompleted: updateAmountText() Label {
Connections { text: Config.baseUnit
target: finalizer color: Material.accentColor
function onEffectiveAmountChanged() {
updateAmountText()
} }
}
}
Label { Label {
text: qsTr('Mining fee') id: fiatValue
} Layout.fillWidth: true
font.pixelSize: constants.fontSizeMedium
}
RowLayout { Component.onCompleted: updateAmountText()
Label { Connections {
id: fee target: finalizer
text: Config.formatSats(finalizer.fee) function onEffectiveAmountChanged() {
updateAmountText()
}
}
} }
Label { Label {
text: Config.baseUnit text: qsTr('Mining fee')
color: Material.accentColor color: Material.accentColor
} }
}
Label { RowLayout {
text: qsTr('Fee rate') Label {
} id: fee
text: Config.formatSats(finalizer.fee)
}
RowLayout { Label {
Label { text: Config.baseUnit
id: feeRate color: Material.accentColor
text: finalizer.feeRate }
} }
Label { Label {
text: 'sat/vB' text: qsTr('Fee rate')
color: Material.accentColor color: Material.accentColor
} }
}
Label {
text: qsTr('Target')
}
Label { RowLayout {
id: targetdesc Label {
text: finalizer.target id: feeRate
} text: finalizer.feeRate
}
Slider { Label {
id: feeslider text: 'sat/vB'
snapMode: Slider.SnapOnRelease color: Material.accentColor
stepSize: 1
from: 0
to: finalizer.sliderSteps
onValueChanged: {
if (activeFocus)
finalizer.sliderPos = value
}
Component.onCompleted: {
value = finalizer.sliderPos
}
Connections {
target: finalizer
function onSliderPosChanged() {
feeslider.value = finalizer.sliderPos
} }
} }
}
ComboBox { Label {
id: target text: qsTr('Target')
textRole: 'text' color: Material.accentColor
valueRole: 'value'
model: [
{ text: qsTr('ETA'), value: 1 },
{ text: qsTr('Mempool'), value: 2 },
{ text: qsTr('Static'), value: 0 }
]
onCurrentValueChanged: {
if (activeFocus)
finalizer.method = currentValue
}
Component.onCompleted: {
currentIndex = indexOfValue(finalizer.method)
} }
}
InfoTextArea { Label {
Layout.columnSpan: 2 id: targetdesc
visible: finalizer.warning != '' text: finalizer.target
text: finalizer.warning }
iconStyle: InfoTextArea.IconStyle.Warn
} Slider {
id: feeslider
leftPadding: constants.paddingMedium
snapMode: Slider.SnapOnRelease
stepSize: 1
from: 0
to: finalizer.sliderSteps
onValueChanged: {
if (activeFocus)
finalizer.sliderPos = value
}
Component.onCompleted: {
value = finalizer.sliderPos
}
Connections {
target: finalizer
function onSliderPosChanged() {
feeslider.value = finalizer.sliderPos
}
}
}
CheckBox { ComboBox {
id: final_cb id: target
text: qsTr('Replace-by-Fee') textRole: 'text'
Layout.columnSpan: 2 valueRole: 'value'
checked: finalizer.rbf model: [
visible: finalizer.canRbf { text: qsTr('ETA'), value: 1 },
} { text: qsTr('Mempool'), value: 2 },
{ text: qsTr('Static'), value: 0 }
]
onCurrentValueChanged: {
if (activeFocus)
finalizer.method = currentValue
}
Component.onCompleted: {
currentIndex = indexOfValue(finalizer.method)
}
}
Rectangle { InfoTextArea {
height: 1 Layout.columnSpan: 2
Layout.fillWidth: true visible: finalizer.warning != ''
Layout.columnSpan: 2 text: finalizer.warning
color: Material.accentColor iconStyle: InfoTextArea.IconStyle.Warn
} }
Label { CheckBox {
text: qsTr('Outputs') id: final_cb
Layout.columnSpan: 2 text: qsTr('Replace-by-Fee')
} Layout.columnSpan: 2
checked: finalizer.rbf
visible: finalizer.canRbf
}
Repeater { Label {
model: finalizer.outputs text: qsTr('Outputs')
delegate: TextHighlightPane {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true color: Material.accentColor
padding: 0 }
leftPadding: constants.paddingSmall
RowLayout { Repeater {
width: parent.width model: finalizer.outputs
Label { delegate: TextHighlightPane {
text: modelData.address Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
wrapMode: Text.Wrap padding: 0
font.pixelSize: constants.fontSizeLarge leftPadding: constants.paddingSmall
font.family: FixedFont RowLayout {
color: modelData.is_mine ? constants.colorMine : Material.foreground width: parent.width
} Label {
Label { text: modelData.address
text: Config.formatSats(modelData.value_sats) Layout.fillWidth: true
font.pixelSize: constants.fontSizeMedium wrapMode: Text.Wrap
font.family: FixedFont font.pixelSize: constants.fontSizeLarge
} font.family: FixedFont
Label { color: modelData.is_mine ? constants.colorMine : Material.foreground
text: Config.baseUnit }
font.pixelSize: constants.fontSizeMedium Label {
color: Material.accentColor text: Config.formatSats(modelData.value_sats)
font.pixelSize: constants.fontSizeMedium
font.family: FixedFont
}
Label {
text: Config.baseUnit
font.pixelSize: constants.fontSizeMedium
color: Material.accentColor
}
} }
} }
} }
} }
Rectangle {
height: 1
Layout.fillWidth: true
Layout.columnSpan: 2
color: Material.accentColor
}
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 } Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
RowLayout { FlatButton {
Layout.columnSpan: 2 id: sendButton
Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true
text: Daemon.currentWallet.isWatchOnly ? qsTr('Finalize') : qsTr('Pay')
Button { icon.source: '../../icons/confirmed.png'
text: qsTr('Cancel') enabled: finalizer.valid
onClicked: { onClicked: {
txcancelled() txaccepted()
dialog.close() dialog.close()
}
}
Button {
id: sendButton
text: Daemon.currentWallet.isWatchOnly ? qsTr('Finalize') : qsTr('Pay')
enabled: finalizer.valid
onClicked: {
txaccepted()
dialog.close()
}
} }
} }
} }
onClosed: txcancelled()
} }

38
electrum/gui/qml/components/GenericShareDialog.qml

@ -26,20 +26,6 @@ ElDialog {
color: "#aa000000" color: "#aa000000"
} }
// header: RowLayout {
// width: dialog.width
// Label {
// Layout.fillWidth: true
// text: dialog.title
// visible: dialog.title
// elide: Label.ElideRight
// padding: constants.paddingXLarge
// bottomPadding: 0
// font.bold: true
// font.pixelSize: constants.fontSizeMedium
// }
// }
Flickable { Flickable {
anchors.fill: parent anchors.fill: parent
contentHeight: rootLayout.height contentHeight: rootLayout.height
@ -51,12 +37,6 @@ ElDialog {
width: parent.width width: parent.width
spacing: constants.paddingMedium spacing: constants.paddingMedium
Rectangle {
height: 1
Layout.fillWidth: true
color: Material.accentColor
}
QRImage { QRImage {
id: qr id: qr
render: dialog.enter ? false : true render: dialog.enter ? false : true
@ -66,12 +46,6 @@ ElDialog {
Layout.bottomMargin: constants.paddingSmall Layout.bottomMargin: constants.paddingSmall
} }
Rectangle {
height: 1
Layout.fillWidth: true
color: Material.accentColor
}
TextHighlightPane { TextHighlightPane {
Layout.fillWidth: true Layout.fillWidth: true
Label { Label {
@ -92,15 +66,23 @@ ElDialog {
Layout.fillWidth: true Layout.fillWidth: true
} }
Rectangle {
height: 1
Layout.preferredWidth: qr.width
Layout.alignment: Qt.AlignHCenter
color: Material.accentColor
}
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Button {
FlatButton {
text: qsTr('Copy') text: qsTr('Copy')
icon.source: '../../icons/copy_bw.png' icon.source: '../../icons/copy_bw.png'
onClicked: AppController.textToClipboard(dialog.text) onClicked: AppController.textToClipboard(dialog.text)
} }
Button { FlatButton {
text: qsTr('Share') text: qsTr('Share')
icon.source: '../../icons/share.png' icon.source: '../../icons/share.png'
onClicked: { onClicked: {

454
electrum/gui/qml/components/InvoiceDialog.qml

@ -18,291 +18,297 @@ ElDialog {
title: qsTr('Invoice') title: qsTr('Invoice')
standardButtons: invoice_key != '' ? Dialog.Close : Dialog.Cancel standardButtons: invoice_key != '' ? Dialog.Close : Dialog.Cancel
padding: 0
modal: true modal: true
parent: Overlay.overlay parent: Overlay.overlay
Overlay.modal: Rectangle { Overlay.modal: Rectangle {
color: "#aa000000" color: "#aa000000"
} }
GridLayout { ColumnLayout {
id: layout
width: parent.width width: parent.width
height: parent.height height: parent.height
columns: 2 spacing: 0
Label {
text: qsTr('Type')
color: Material.accentColor
}
RowLayout { GridLayout {
Layout.fillWidth: true id: layout
Image { width: parent.width
Layout.preferredWidth: constants.iconSizeSmall Layout.leftMargin: constants.paddingLarge
Layout.preferredHeight: constants.iconSizeSmall Layout.rightMargin: constants.paddingLarge
source: invoice.invoiceType == Invoice.LightningInvoice columns: 2
? "../../icons/lightning.png"
: "../../icons/bitcoin.png"
}
Label { Label {
text: invoice.invoiceType == Invoice.OnchainInvoice text: qsTr('Type')
? qsTr('On chain') color: Material.accentColor
: invoice.invoiceType == Invoice.LightningInvoice
? qsTr('Lightning')
: ''
Layout.fillWidth: true
} }
}
Label { RowLayout {
text: qsTr('Status') Layout.fillWidth: true
color: Material.accentColor Image {
} Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
Label { source: invoice.invoiceType == Invoice.LightningInvoice
text: invoice.status_str ? "../../icons/lightning.png"
} : "../../icons/bitcoin.png"
}
Label {
visible: invoice.invoiceType == Invoice.OnchainInvoice
Layout.columnSpan: 2
text: qsTr('Address')
color: Material.accentColor
}
TextHighlightPane { Label {
visible: invoice.invoiceType == Invoice.OnchainInvoice text: invoice.invoiceType == Invoice.OnchainInvoice
? qsTr('On chain')
: invoice.invoiceType == Invoice.LightningInvoice
? qsTr('Lightning')
: ''
Layout.fillWidth: true
}
}
Layout.columnSpan: 2 Label {
Layout.fillWidth: true text: qsTr('Status')
color: Material.accentColor
}
padding: 0 Label {
leftPadding: constants.paddingMedium text: invoice.status_str
}
Label { Label {
width: parent.width visible: invoice.invoiceType == Invoice.OnchainInvoice
text: invoice.address Layout.columnSpan: 2
font.family: FixedFont text: qsTr('Address')
wrapMode: Text.Wrap color: Material.accentColor
} }
}
Label { TextHighlightPane {
visible: invoice.invoiceType == Invoice.LightningInvoice visible: invoice.invoiceType == Invoice.OnchainInvoice
text: qsTr('Remote Pubkey')
color: Material.accentColor
}
TextHighlightPane { Layout.columnSpan: 2
visible: invoice.invoiceType == Invoice.LightningInvoice Layout.fillWidth: true
Layout.columnSpan: 2 padding: 0
Layout.fillWidth: true leftPadding: constants.paddingMedium
padding: 0 Label {
leftPadding: constants.paddingMedium width: parent.width
text: invoice.address
font.family: FixedFont
wrapMode: Text.Wrap
}
}
Label { Label {
width: parent.width visible: invoice.invoiceType == Invoice.LightningInvoice
text: invoice.lnprops ? invoice.lnprops.pubkey : '' text: qsTr('Remote Pubkey')
font.family: FixedFont color: Material.accentColor
wrapMode: Text.Wrap
} }
}
Label { TextHighlightPane {
text: qsTr('Description') visible: invoice.invoiceType == Invoice.LightningInvoice
visible: invoice.message
Layout.columnSpan: 2
color: Material.accentColor
}
TextHighlightPane { Layout.columnSpan: 2
visible: invoice.message Layout.fillWidth: true
Layout.columnSpan: 2 padding: 0
Layout.preferredWidth: parent.width leftPadding: constants.paddingMedium
Layout.alignment: Qt.AlignHCenter
padding: 0 Label {
leftPadding: constants.paddingMedium width: parent.width
text: invoice.lnprops ? invoice.lnprops.pubkey : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
}
Label { Label {
text: invoice.message text: qsTr('Description')
width: parent.width visible: invoice.message
font.pixelSize: constants.fontSizeXLarge Layout.columnSpan: 2
wrapMode: Text.Wrap color: Material.accentColor
elide: Text.ElideRight
} }
}
Label {
text: qsTr('Amount to send')
color: Material.accentColor
Layout.columnSpan: 2
}
TextHighlightPane { TextHighlightPane {
id: amountContainer visible: invoice.message
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.preferredWidth: parent.width //* 0.75 Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
padding: 0 padding: 0
leftPadding: constants.paddingXXLarge leftPadding: constants.paddingMedium
property bool editmode: false Label {
text: invoice.message
width: parent.width
font.pixelSize: constants.fontSizeXLarge
wrapMode: Text.Wrap
elide: Text.ElideRight
}
}
RowLayout { Label {
id: amountLayout text: qsTr('Amount to send')
width: parent.width color: Material.accentColor
Layout.columnSpan: 2
GridLayout { }
visible: !amountContainer.editmode
columns: 2
Label {
font.pixelSize: constants.fontSizeXLarge
font.family: FixedFont
font.bold: true
text: Config.formatSats(invoice.amount, false)
}
Label { TextHighlightPane {
Layout.fillWidth: true id: amountContainer
text: Config.baseUnit
color: Material.accentColor
font.pixelSize: constants.fontSizeXLarge
}
Label { Layout.columnSpan: 2
id: fiatValue Layout.fillWidth: true
visible: Daemon.fx.enabled Layout.alignment: Qt.AlignHCenter
text: Daemon.fx.fiatValue(invoice.amount, false)
font.pixelSize: constants.fontSizeMedium padding: 0
color: constants.mutedForeground leftPadding: constants.paddingXXLarge
}
property bool editmode: false
RowLayout {
id: amountLayout
width: parent.width
GridLayout {
visible: !amountContainer.editmode
columns: 2
Label {
font.pixelSize: constants.fontSizeXLarge
font.family: FixedFont
font.bold: true
text: Config.formatSats(invoice.amount, false)
}
Label {
Layout.fillWidth: true
text: Config.baseUnit
color: Material.accentColor
font.pixelSize: constants.fontSizeXLarge
}
Label {
id: fiatValue
visible: Daemon.fx.enabled
text: Daemon.fx.fiatValue(invoice.amount, false)
font.pixelSize: constants.fontSizeMedium
color: constants.mutedForeground
}
Label {
visible: Daemon.fx.enabled
Layout.fillWidth: true
text: Daemon.fx.fiatCurrency
font.pixelSize: constants.fontSizeMedium
color: constants.mutedForeground
}
Label {
visible: Daemon.fx.enabled
Layout.fillWidth: true
text: Daemon.fx.fiatCurrency
font.pixelSize: constants.fontSizeMedium
color: constants.mutedForeground
} }
} ToolButton {
visible: !amountContainer.editmode
ToolButton { icon.source: '../../icons/pen.png'
visible: !amountContainer.editmode icon.color: 'transparent'
icon.source: '../../icons/pen.png' onClicked: {
icon.color: 'transparent' amountBtc.text = invoice.amount.satsInt == 0 ? '' : Config.formatSats(invoice.amount)
onClicked: { amountContainer.editmode = true
amountBtc.text = invoice.amount.satsInt == 0 ? '' : Config.formatSats(invoice.amount) amountBtc.focus = true
amountContainer.editmode = true }
amountBtc.focus = true
} }
} GridLayout {
GridLayout { visible: amountContainer.editmode
visible: amountContainer.editmode
Layout.fillWidth: true
columns: 2
BtcField {
id: amountBtc
fiatfield: amountFiat
}
Label {
text: Config.baseUnit
color: Material.accentColor
Layout.fillWidth: true Layout.fillWidth: true
columns: 2
BtcField {
id: amountBtc
fiatfield: amountFiat
}
Label {
text: Config.baseUnit
color: Material.accentColor
Layout.fillWidth: true
}
FiatField {
id: amountFiat
btcfield: amountBtc
visible: Daemon.fx.enabled
}
Label {
visible: Daemon.fx.enabled
text: Daemon.fx.fiatCurrency
color: Material.accentColor
}
} }
ToolButton {
FiatField { visible: amountContainer.editmode
id: amountFiat Layout.fillWidth: false
btcfield: amountBtc icon.source: '../../icons/confirmed.png'
visible: Daemon.fx.enabled icon.color: 'transparent'
} onClicked: {
amountContainer.editmode = false
Label { invoice.amount = Config.unitsToSats(amountBtc.text)
visible: Daemon.fx.enabled }
text: Daemon.fx.fiatCurrency
color: Material.accentColor
} }
} ToolButton {
ToolButton { visible: amountContainer.editmode
visible: amountContainer.editmode Layout.fillWidth: false
Layout.fillWidth: false icon.source: '../../icons/closebutton.png'
icon.source: '../../icons/confirmed.png' icon.color: 'transparent'
icon.color: 'transparent' onClicked: amountContainer.editmode = false
onClicked: {
amountContainer.editmode = false
invoice.amount = Config.unitsToSats(amountBtc.text)
} }
} }
ToolButton {
visible: amountContainer.editmode
Layout.fillWidth: false
icon.source: '../../icons/closebutton.png'
icon.color: 'transparent'
onClicked: amountContainer.editmode = false
}
}
} }
Item { Layout.preferredHeight: constants.paddingLarge; Layout.preferredWidth: 1 } Item { Layout.preferredHeight: constants.paddingLarge; Layout.preferredWidth: 1 }
InfoTextArea { InfoTextArea {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
visible: invoice.userinfo visible: invoice.userinfo
text: invoice.userinfo text: invoice.userinfo
}
} }
RowLayout { Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
spacing: constants.paddingMedium
FlatButton {
text: qsTr('Delete')
icon.source: '../../icons/delete.png'
visible: invoice_key != ''
onClicked: {
invoice.wallet.delete_invoice(invoice_key)
dialog.close()
}
}
FlatButton { FlatButton {
text: qsTr('Save') Layout.fillWidth: true
icon.source: '../../icons/save.png' text: qsTr('Pay')
visible: invoice_key == '' icon.source: '../../icons/confirmed.png'
enabled: invoice.canSave enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay
onClicked: { onClicked: {
app.stack.push(Qt.resolvedUrl('Invoices.qml')) if (invoice_key == '') // save invoice if not retrieved from key
invoice.save_invoice() invoice.save_invoice()
dialog.close() dialog.close()
} doPay() // only signal here
}
}
FlatButton {
Layout.fillWidth: true
text: qsTr('Delete')
icon.source: '../../icons/delete.png'
visible: invoice_key != ''
onClicked: {
invoice.wallet.delete_invoice(invoice_key)
dialog.close()
} }
}
FlatButton { FlatButton {
text: qsTr('Pay') Layout.fillWidth: true
icon.source: '../../icons/confirmed.png' text: qsTr('Save')
enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay icon.source: '../../icons/save.png'
onClicked: { visible: invoice_key == ''
if (invoice_key == '') // save invoice if not retrieved from key enabled: invoice.canSave
invoice.save_invoice() onClicked: {
dialog.close() app.stack.push(Qt.resolvedUrl('Invoices.qml'))
doPay() // only signal here invoice.save_invoice()
} dialog.close()
} }
} }
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
} }
Component.onCompleted: { Component.onCompleted: {

36
electrum/gui/qml/components/PasswordDialog.qml

@ -19,19 +19,23 @@ ElDialog {
parent: Overlay.overlay parent: Overlay.overlay
modal: true modal: true
x: (parent.width - width) / 2 standardButtons: Dialog.Cancel
y: (parent.height - height) / 2 anchors.centerIn: parent
padding: 0
Overlay.modal: Rectangle { Overlay.modal: Rectangle {
color: "#aa000000" color: "#aa000000"
} }
ColumnLayout { ColumnLayout {
width: parent.width width: parent.width
spacing: 0
InfoTextArea { InfoTextArea {
visible: infotext visible: infotext
text: infotext text: infotext
Layout.preferredWidth: password_layout.width Layout.margins: constants.paddingMedium
Layout.fillWidth: true
} }
GridLayout { GridLayout {
@ -59,25 +63,15 @@ ElDialog {
} }
} }
RowLayout { FlatButton {
Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true
Layout.topMargin: constants.paddingXXLarge text: qsTr("Ok")
icon.source: '../../icons/confirmed.png'
Button { enabled: confirmPassword ? pw_1.text == pw_2.text : true
text: qsTr("Ok") onClicked: {
enabled: confirmPassword ? pw_1.text == pw_2.text : true password = pw_1.text
onClicked: { passworddialog.accept()
password = pw_1.text
passworddialog.accept()
}
}
Button {
text: qsTr("Cancel")
onClicked: {
passworddialog.reject()
}
} }
} }
} }
} }

3
electrum/gui/qml/components/SendDialog.qml

@ -20,7 +20,9 @@ ElDialog {
color: "#aa000000" color: "#aa000000"
} }
header: Item {}
padding: 0 padding: 0
topPadding: 0
function restart() { function restart() {
qrscan.restart() qrscan.restart()
@ -28,6 +30,7 @@ ElDialog {
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 0
QRScan { QRScan {
id: qrscan id: qrscan

77
electrum/gui/qml/components/controls/InfoTextArea.qml

@ -3,9 +3,7 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls 2.1 import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material 2.0
GridLayout { Item {
property alias text: infotext.text
enum IconStyle { enum IconStyle {
None, None,
Info, Info,
@ -13,47 +11,54 @@ GridLayout {
Error Error
} }
property alias text: infotext.text
property int iconStyle: InfoTextArea.IconStyle.Info property int iconStyle: InfoTextArea.IconStyle.Info
property alias textFormat: infotext.textFormat property alias textFormat: infotext.textFormat
columns: 1 implicitHeight: layout.height
rowSpacing: 0
Rectangle { ColumnLayout {
height: 2 id: layout
Layout.fillWidth: true
color: Qt.rgba(1,1,1,0.25)
}
TextArea { spacing: 0
id: infotext width: parent.width
Layout.fillWidth: true
Layout.minimumHeight: constants.iconSizeLarge + 2*constants.paddingLarge
readOnly: true
rightPadding: constants.paddingLarge
leftPadding: 2*constants.iconSizeLarge
wrapMode: TextInput.Wrap
textFormat: TextEdit.RichText
background: Rectangle {
color: Qt.rgba(1,1,1,0.05) // whiten 5%
}
Image { Rectangle {
source: iconStyle == InfoTextArea.IconStyle.Info ? "../../../icons/info.png" : iconStyle == InfoTextArea.IconStyle.Warn ? "../../../icons/warning.png" : iconStyle == InfoTextArea.IconStyle.Error ? "../../../icons/expired.png" : "" height: 2
anchors.left: parent.left Layout.fillWidth: true
anchors.top: parent.top color: Qt.rgba(1,1,1,0.25)
anchors.leftMargin: constants.paddingLarge
anchors.topMargin: constants.paddingLarge
height: constants.iconSizeLarge
width: constants.iconSizeLarge
fillMode: Image.PreserveAspectCrop
} }
} TextArea {
id: infotext
Layout.fillWidth: true
Layout.minimumHeight: constants.iconSizeLarge + 2*constants.paddingLarge
readOnly: true
rightPadding: constants.paddingLarge
leftPadding: 2*constants.iconSizeLarge
wrapMode: TextInput.Wrap
textFormat: TextEdit.RichText
background: Rectangle {
color: Qt.rgba(1,1,1,0.05) // whiten 5%
}
Image {
source: iconStyle == InfoTextArea.IconStyle.Info ? "../../../icons/info.png" : iconStyle == InfoTextArea.IconStyle.Warn ? "../../../icons/warning.png" : iconStyle == InfoTextArea.IconStyle.Error ? "../../../icons/expired.png" : ""
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: constants.paddingLarge
anchors.topMargin: constants.paddingLarge
height: constants.iconSizeLarge
width: constants.iconSizeLarge
fillMode: Image.PreserveAspectCrop
}
Rectangle { }
height: 2
Layout.fillWidth: true Rectangle {
color: Qt.rgba(0,0,0,0.25) height: 2
Layout.fillWidth: true
color: Qt.rgba(0,0,0,0.25)
}
} }
} }

Loading…
Cancel
Save