Browse Source

qml: ui

patch-4
Sander van Grieken 2 years ago
parent
commit
c7cdd42665
  1. 18
      electrum/gui/qml/components/AddressDetails.qml
  2. 56
      electrum/gui/qml/components/ConfirmTxDialog.qml
  3. 38
      electrum/gui/qml/components/GenericShareDialog.qml
  4. 48
      electrum/gui/qml/components/InvoiceDialog.qml
  5. 26
      electrum/gui/qml/components/PasswordDialog.qml
  6. 3
      electrum/gui/qml/components/SendDialog.qml
  7. 15
      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)
}
}
} }
} }

56
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,22 +45,21 @@ 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 { Label {
id: amountLabel id: amountLabel
text: qsTr('Amount to send') text: qsTr('Amount to send')
color: Material.accentColor
} }
RowLayout { RowLayout {
@ -89,6 +91,7 @@ ElDialog {
Label { Label {
text: qsTr('Mining fee') text: qsTr('Mining fee')
color: Material.accentColor
} }
RowLayout { RowLayout {
@ -105,6 +108,7 @@ ElDialog {
Label { Label {
text: qsTr('Fee rate') text: qsTr('Fee rate')
color: Material.accentColor
} }
RowLayout { RowLayout {
@ -121,6 +125,7 @@ ElDialog {
Label { Label {
text: qsTr('Target') text: qsTr('Target')
color: Material.accentColor
} }
Label { Label {
@ -130,6 +135,7 @@ ElDialog {
Slider { Slider {
id: feeslider id: feeslider
leftPadding: constants.paddingMedium
snapMode: Slider.SnapOnRelease snapMode: Slider.SnapOnRelease
stepSize: 1 stepSize: 1
from: 0 from: 0
@ -182,16 +188,10 @@ ElDialog {
visible: finalizer.canRbf visible: finalizer.canRbf
} }
Rectangle {
height: 1
Layout.fillWidth: true
Layout.columnSpan: 2
color: Material.accentColor
}
Label { Label {
text: qsTr('Outputs') text: qsTr('Outputs')
Layout.columnSpan: 2 Layout.columnSpan: 2
color: Material.accentColor
} }
Repeater { Repeater {
@ -224,31 +224,15 @@ ElDialog {
} }
} }
} }
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
Layout.alignment: Qt.AlignHCenter
Button {
text: qsTr('Cancel')
onClicked: {
txcancelled()
dialog.close()
}
}
Button {
id: sendButton id: sendButton
Layout.fillWidth: true
text: Daemon.currentWallet.isWatchOnly ? qsTr('Finalize') : qsTr('Pay') text: Daemon.currentWallet.isWatchOnly ? qsTr('Finalize') : qsTr('Pay')
icon.source: '../../icons/confirmed.png'
enabled: finalizer.valid enabled: finalizer.valid
onClicked: { onClicked: {
txaccepted() txaccepted()
@ -256,6 +240,6 @@ ElDialog {
} }
} }
} }
}
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: {

48
electrum/gui/qml/components/InvoiceDialog.qml

@ -18,16 +18,24 @@ 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"
} }
ColumnLayout {
width: parent.width
height: parent.height
spacing: 0
GridLayout { GridLayout {
id: layout id: layout
width: parent.width width: parent.width
height: parent.height Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
columns: 2 columns: 2
Label { Label {
@ -122,7 +130,7 @@ ElDialog {
visible: invoice.message visible: invoice.message
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.preferredWidth: parent.width Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
padding: 0 padding: 0
@ -147,7 +155,7 @@ ElDialog {
id: amountContainer id: amountContainer
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
@ -261,13 +269,24 @@ ElDialog {
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 { FlatButton {
Layout.fillWidth: true
text: qsTr('Pay')
icon.source: '../../icons/confirmed.png'
enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay
onClicked: {
if (invoice_key == '') // save invoice if not retrieved from key
invoice.save_invoice()
dialog.close()
doPay() // only signal here
}
}
FlatButton {
Layout.fillWidth: true
text: qsTr('Delete') text: qsTr('Delete')
icon.source: '../../icons/delete.png' icon.source: '../../icons/delete.png'
visible: invoice_key != '' visible: invoice_key != ''
@ -278,6 +297,7 @@ ElDialog {
} }
FlatButton { FlatButton {
Layout.fillWidth: true
text: qsTr('Save') text: qsTr('Save')
icon.source: '../../icons/save.png' icon.source: '../../icons/save.png'
visible: invoice_key == '' visible: invoice_key == ''
@ -289,20 +309,6 @@ ElDialog {
} }
} }
FlatButton {
text: qsTr('Pay')
icon.source: '../../icons/confirmed.png'
enabled: invoice.invoiceType != Invoice.Invalid && invoice.canPay
onClicked: {
if (invoice_key == '') // save invoice if not retrieved from key
invoice.save_invoice()
dialog.close()
doPay() // only signal here
}
}
}
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
} }
Component.onCompleted: { Component.onCompleted: {

26
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
Button {
text: qsTr("Ok") text: qsTr("Ok")
icon.source: '../../icons/confirmed.png'
enabled: confirmPassword ? pw_1.text == pw_2.text : true enabled: confirmPassword ? pw_1.text == pw_2.text : true
onClicked: { onClicked: {
password = pw_1.text password = pw_1.text
passworddialog.accept() 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

15
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,11 +11,17 @@ 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
ColumnLayout {
id: layout
spacing: 0
width: parent.width
Rectangle { Rectangle {
height: 2 height: 2
@ -56,4 +60,5 @@ GridLayout {
Layout.fillWidth: true Layout.fillWidth: true
color: Qt.rgba(0,0,0,0.25) color: Qt.rgba(0,0,0,0.25)
} }
}
} }

Loading…
Cancel
Save