1
0

qml: fixes TextHighlightPane

This commit is contained in:
Sander van Grieken
2023-02-09 01:13:05 +01:00
parent 72d750c51c
commit 1e60cb740f
15 changed files with 93 additions and 84 deletions

View File

@@ -22,7 +22,7 @@ Pane {
spacing: 0
Flickable {
Layout.preferredWidth: parent.width
Layout.fillWidth: true
Layout.fillHeight: true
leftMargin: constants.paddingLarge
@@ -48,8 +48,6 @@ Pane {
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
@@ -86,8 +84,6 @@ Pane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
@@ -144,8 +140,7 @@ Pane {
delegate: TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
Label {

View File

@@ -175,8 +175,6 @@ Pane {
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width

View File

@@ -71,8 +71,6 @@ ElDialog {
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
Label {
width: parent.width

View File

@@ -49,11 +49,12 @@ ElDialog {
spacing: 0
GridLayout {
width: parent.width
columns: 2
Layout.fillWidth: true
Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
columns: 2
Label {
id: amountLabel
text: qsTr('Amount to send')
@@ -181,8 +182,7 @@ ElDialog {
delegate: TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
Label {

View File

@@ -37,6 +37,7 @@ Item {
property color colorMine: "yellow"
property color colorError: '#ffff8080'
property color colorWarning: 'yellow'
property color colorLightningLocal: "blue"
property color colorLightningRemote: "yellow"
property color colorChannelOpen: "#ff80ff80"

View File

@@ -50,6 +50,28 @@ ElDialog {
columns: 2
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
visible: invoice.userinfo
borderColor: constants.colorWarning
padding: constants.paddingXLarge
RowLayout {
Image {
source: '../../icons/warning.png'
Layout.preferredWidth: constants.iconSizeMedium
Layout.preferredHeight: constants.iconSizeMedium
}
Label {
width: parent.width
text: invoice.userinfo
wrapMode: Text.Wrap
}
}
}
Label {
text: qsTr('Type')
color: Material.accentColor
@@ -92,12 +114,10 @@ ElDialog {
}
TextHighlightPane {
visible: invoice.invoiceType == Invoice.OnchainInvoice
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
visible: invoice.invoiceType == Invoice.OnchainInvoice
leftPadding: constants.paddingMedium
Label {
@@ -115,19 +135,32 @@ ElDialog {
}
TextHighlightPane {
visible: invoice.invoiceType == Invoice.LightningInvoice
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
visible: invoice.invoiceType == Invoice.LightningInvoice
leftPadding: constants.paddingMedium
Label {
RowLayout {
width: parent.width
text: 'pubkey' in invoice.lnprops ? invoice.lnprops.pubkey : ''
font.family: FixedFont
wrapMode: Text.Wrap
Label {
id: pubkeyLabel
Layout.fillWidth: true
text: 'pubkey' in invoice.lnprops ? invoice.lnprops.pubkey : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
enabled: pubkeyLabel.text
onClicked: {
var dialog = app.genericShareDialog.createObject(app,
{ title: qsTr('Node public key'), text: invoice.lnprops.pubkey }
)
dialog.open()
}
}
}
}
@@ -138,19 +171,32 @@ ElDialog {
}
TextHighlightPane {
visible: invoice.invoiceType == Invoice.LightningInvoice
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
visible: invoice.invoiceType == Invoice.LightningInvoice
leftPadding: constants.paddingMedium
Label {
RowLayout {
width: parent.width
text: 'payment_hash' in invoice.lnprops ? invoice.lnprops.payment_hash : ''
font.family: FixedFont
wrapMode: Text.Wrap
Label {
id: paymenthashLabel
Layout.fillWidth: true
text: 'payment_hash' in invoice.lnprops ? invoice.lnprops.payment_hash : ''
font.family: FixedFont
wrapMode: Text.Wrap
}
ToolButton {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
enabled: paymenthashLabel.text
onClicked: {
var dialog = app.genericShareDialog.createObject(app,
{ title: qsTr('Payment hash'), text: invoice.lnprops.payment_hash }
)
dialog.open()
}
}
}
}
@@ -162,13 +208,10 @@ ElDialog {
}
TextHighlightPane {
visible: invoice.message
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
padding: 0
visible: invoice.message
leftPadding: constants.paddingMedium
Label {
@@ -193,8 +236,7 @@ ElDialog {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
padding: 0
leftPadding: constants.paddingXXLarge
leftPadding: constants.paddingXLarge
property bool editmode: false
@@ -325,15 +367,6 @@ ElDialog {
}
Item { Layout.preferredHeight: constants.paddingLarge; Layout.preferredWidth: 1 }
InfoTextArea {
Layout.columnSpan: 2
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: parent.width * 3/4
visible: invoice.userinfo
text: invoice.userinfo
}
}
}

View File

@@ -92,8 +92,6 @@ Pane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
@@ -148,8 +146,6 @@ Pane {
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
@@ -182,8 +178,6 @@ Pane {
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
@@ -216,8 +210,6 @@ Pane {
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width

View File

@@ -197,8 +197,7 @@ ElDialog {
delegate: TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
Label {

View File

@@ -32,9 +32,10 @@ ElDialog {
spacing: 0
GridLayout {
Layout.preferredWidth: parent.width
Layout.fillWidth: true
Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
columns: 2
Label {
@@ -169,8 +170,7 @@ ElDialog {
delegate: TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
Label {

View File

@@ -197,8 +197,6 @@ Pane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
@@ -253,8 +251,6 @@ Pane {
TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
@@ -290,8 +286,7 @@ Pane {
delegate: TextHighlightPane {
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width
Label {

View File

@@ -4,13 +4,14 @@ import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
Pane {
topPadding: constants.paddingSmall
bottomPadding: constants.paddingSmall
leftPadding: constants.paddingSmall
rightPadding: constants.paddingSmall
padding: constants.paddingSmall
property color backgroundColor: Qt.lighter(Material.background, 1.15)
property color borderColor: null
background: Rectangle {
color: Qt.lighter(Material.background, 1.15)
color: backgroundColor
border.color: borderColor ? borderColor : backgroundColor
radius: constants.paddingSmall
}
}

View File

@@ -30,17 +30,17 @@ WizardComponent {
width: parent.width
Label {
Layout.fillWidth: true
visible: cosigner
text: qsTr('Here is your master public key. Please share it with your cosigners')
Layout.fillWidth: true
wrapMode: Text.Wrap
}
TextHighlightPane {
visible: cosigner
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
visible: cosigner
RowLayout {
width: parent.width

View File

@@ -54,17 +54,17 @@ WizardComponent {
width: parent.width
Label {
Layout.fillWidth: true
visible: cosigner
text: qsTr('Here is your master public key. Please share it with your cosigners')
Layout.fillWidth: true
wrapMode: Text.Wrap
}
TextHighlightPane {
visible: cosigner
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
visible: cosigner
RowLayout {
width: parent.width

View File

@@ -93,11 +93,10 @@ WizardComponent {
}
TextHighlightPane {
visible: cosigner
Layout.columnSpan: 2
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
visible: cosigner
RowLayout {
width: parent.width

View File

@@ -22,8 +22,6 @@ WizardComponent {
TextHighlightPane {
Layout.fillWidth: true
padding: 0
leftPadding: constants.paddingSmall
RowLayout {
width: parent.width