Browse Source

styling

patch-4
Sander van Grieken 3 years ago
parent
commit
f8dd411148
  1. 46
      electrum/gui/qml/components/InvoiceDialog.qml
  2. 1
      electrum/gui/qml/components/RequestDialog.qml
  3. 5
      electrum/gui/qml/components/TxDetails.qml
  4. 123
      electrum/gui/qml/components/controls/GenericShareDialog.qml
  5. 2
      electrum/gui/qml/components/controls/TextHighlightPane.qml

46
electrum/gui/qml/components/InvoiceDialog.qml

@ -44,24 +44,25 @@ Dialog {
text: qsTr('Type') text: qsTr('Type')
} }
Label { RowLayout {
text: invoice.invoiceType == Invoice.OnchainInvoice
? qsTr('On-chain invoice')
: invoice.invoiceType == Invoice.LightningInvoice
? qsTr('Lightning invoice')
: ''
Layout.fillWidth: true Layout.fillWidth: true
} Image {
//Layout.rowSpan: 2
Label { Layout.preferredWidth: constants.iconSizeSmall
text: qsTr('Description') Layout.preferredHeight: constants.iconSizeSmall
} source: invoice.invoiceType == Invoice.LightningInvoice
? "../../icons/lightning.png"
: "../../icons/bitcoin.png"
}
Label { Label {
text: invoice.message text: invoice.invoiceType == Invoice.OnchainInvoice
Layout.fillWidth: true ? qsTr('On chain')
wrapMode: Text.Wrap : invoice.invoiceType == Invoice.LightningInvoice
elide: Text.ElideRight ? qsTr('Lightning')
: ''
Layout.fillWidth: true
}
} }
Label { Label {
@ -71,6 +72,8 @@ Dialog {
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Label { Label {
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
font.bold: true font.bold: true
text: Config.formatSats(invoice.amount, false) text: Config.formatSats(invoice.amount, false)
} }
@ -90,6 +93,17 @@ Dialog {
} }
} }
Label {
text: qsTr('Description')
}
Label {
text: invoice.message
Layout.fillWidth: true
wrapMode: Text.Wrap
elide: Text.ElideRight
}
Label { Label {
visible: invoice.invoiceType == Invoice.OnchainInvoice visible: invoice.invoiceType == Invoice.OnchainInvoice
text: qsTr('Address') text: qsTr('Address')

1
electrum/gui/qml/components/RequestDialog.qml

@ -142,6 +142,7 @@ Dialog {
text: Config.formatSats(modelItem.amount) text: Config.formatSats(modelItem.amount)
font.family: FixedFont font.family: FixedFont
font.pixelSize: constants.fontSizeLarge font.pixelSize: constants.fontSizeLarge
font.bold: true
} }
Label { Label {
visible: modelItem.amount.satsInt != 0 visible: modelItem.amount.satsInt != 0

5
electrum/gui/qml/components/TxDetails.qml

@ -89,6 +89,7 @@ Pane {
RowLayout { RowLayout {
Label { Label {
text: Config.formatSats(txdetails.amount) text: Config.formatSats(txdetails.amount)
font.family: FixedFont
} }
Label { Label {
text: Config.baseUnit text: Config.baseUnit
@ -106,6 +107,7 @@ Pane {
visible: txdetails.amount.satsInt < 0 visible: txdetails.amount.satsInt < 0
Label { Label {
text: Config.formatSats(txdetails.fee) text: Config.formatSats(txdetails.fee)
font.family: FixedFont
} }
Label { Label {
text: Config.baseUnit text: Config.baseUnit
@ -230,7 +232,8 @@ Pane {
} }
Label { Label {
text: Config.formatSats(modelData.value) text: Config.formatSats(modelData.value)
font.pixelSize: constants.fontSizeLarge font.pixelSize: constants.fontSizeMedium
font.family: FixedFont
} }
Label { Label {
text: Config.baseUnit text: Config.baseUnit

123
electrum/gui/qml/components/controls/GenericShareDialog.qml

@ -34,73 +34,80 @@ Dialog {
} }
} }
ColumnLayout { Flickable {
id: rootLayout anchors.fill: parent
width: parent.width contentHeight: rootLayout.height
spacing: constants.paddingMedium clip:true
interactive: height < contentHeight
Rectangle { ColumnLayout {
height: 1 id: rootLayout
Layout.fillWidth: true width: parent.width
color: Material.accentColor spacing: constants.paddingMedium
}
Image {
id: qr
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: constants.paddingSmall
Layout.bottomMargin: constants.paddingSmall
Rectangle { Rectangle {
property int size: 57 // should be qr pixel multiple height: 1
color: 'white' Layout.fillWidth: true
x: (parent.width - size) / 2 color: Material.accentColor
y: (parent.height - size) / 2
width: size
height: size
Image {
source: '../../../icons/electrum.png'
x: 1
y: 1
width: parent.width - 2
height: parent.height - 2
scale: 0.9
}
} }
}
Rectangle { Image {
height: 1 id: qr
Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter
color: Material.accentColor Layout.topMargin: constants.paddingSmall
} Layout.bottomMargin: constants.paddingSmall
TextHighlightPane { Rectangle {
Layout.fillWidth: true property int size: 57 // should be qr pixel multiple
Label { color: 'white'
width: parent.width x: (parent.width - size) / 2
text: dialog.text y: (parent.height - size) / 2
wrapMode: Text.Wrap width: size
font.pixelSize: constants.fontSizeLarge height: size
font.family: FixedFont
Image {
source: '../../../icons/electrum.png'
x: 1
y: 1
width: parent.width - 2
height: parent.height - 2
scale: 0.9
}
}
} }
}
RowLayout { Rectangle {
Layout.fillWidth: true height: 1
Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true
Button { color: Material.accentColor
text: qsTr('Copy')
icon.source: '../../../icons/copy_bw.png'
onClicked: AppController.textToClipboard(dialog.text)
} }
Button {
//enabled: false TextHighlightPane {
text: qsTr('Share') Layout.fillWidth: true
icon.source: '../../../icons/share.png' Label {
onClicked: { width: parent.width
AppController.doShare(dialog.text, dialog.title) text: dialog.text
wrapMode: Text.Wrap
font.pixelSize: constants.fontSizeLarge
font.family: FixedFont
}
}
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Button {
text: qsTr('Copy')
icon.source: '../../../icons/copy_bw.png'
onClicked: AppController.textToClipboard(dialog.text)
}
Button {
//enabled: false
text: qsTr('Share')
icon.source: '../../../icons/share.png'
onClicked: {
AppController.doShare(dialog.text, dialog.title)
}
} }
} }
} }

2
electrum/gui/qml/components/controls/TextHighlightPane.qml

@ -4,6 +4,8 @@ import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0 import QtQuick.Controls.Material 2.0
Pane { Pane {
topPadding: constants.paddingSmall
bottomPadding: constants.paddingSmall
background: Rectangle { background: Rectangle {
color: Qt.lighter(Material.background, 1.15) color: Qt.lighter(Material.background, 1.15)
radius: constants.paddingSmall radius: constants.paddingSmall

Loading…
Cancel
Save