1
0

qml: define a common Heading component for page section headings

This commit is contained in:
Sander van Grieken
2023-01-17 00:34:01 +01:00
parent aac0e4f693
commit b7964253a8
12 changed files with 56 additions and 154 deletions

View File

@@ -5,6 +5,8 @@ import QtQuick.Controls.Material 2.0
import org.electrum 1.0
import "controls"
Pane {
id: rootItem
padding: 0
@@ -143,19 +145,10 @@ Pane {
ColumnLayout {
width: parent.width
Label {
Layout.topMargin: constants.paddingLarge
Layout.leftMargin: constants.paddingLarge
text: root.section + ' ' + qsTr('addresses')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Heading {
Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
Layout.preferredHeight: 1
Layout.fillWidth: true
color: Material.accentColor
text: root.section + ' ' + qsTr('addresses')
}
}
}

View File

@@ -36,18 +36,9 @@ Pane {
width: parent.width
columns: 2
Label {
Heading {
Layout.columnSpan: 2
text: qsTr('Channel details')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
Label {

View File

@@ -26,18 +26,9 @@ Pane {
columns: 2
Label {
Heading {
Layout.columnSpan: 2
text: qsTr('Lightning Channels')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
Label {

View File

@@ -13,16 +13,8 @@ Pane {
ColumnLayout {
anchors.fill: parent
Label {
Heading {
text: qsTr('Invoices')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
height: 1
Layout.fillWidth: true
color: Material.accentColor
}
Frame {

View File

@@ -28,18 +28,9 @@ Pane {
width: parent.width
columns: 2
Label {
Heading {
Layout.columnSpan: 2
text: qsTr('Lightning payment details')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
Label {

View File

@@ -29,18 +29,9 @@ Pane {
width: parent.width
columns: 2
Label {
Heading {
Layout.columnSpan: 2
text: qsTr('Network')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
Label {
@@ -79,18 +70,9 @@ Pane {
}
}
Label {
Heading {
Layout.columnSpan: 2
text: qsTr('On-chain')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
Label {
@@ -138,18 +120,9 @@ Pane {
id: feeHistogram
}
Label {
Heading {
Layout.columnSpan: 2
text: qsTr('Lightning')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
Label {

View File

@@ -49,18 +49,9 @@ Pane {
width: parent.width
columns: 2
Label {
Heading {
Layout.columnSpan: 2
text: qsTr('Transaction Details')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.columnSpan: 2
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
RowLayout {

View File

@@ -63,25 +63,8 @@ Pane {
width: parent.width
spacing: constants.paddingLarge
RowLayout {
Label {
text: qsTr('Wallet:')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Label {
text: Daemon.currentWallet.name;
font.bold: true
font.pixelSize: constants.fontSizeLarge
Layout.fillWidth: true
}
}
Rectangle {
Layout.fillWidth: true
height: 1
color: Material.accentColor
Heading {
text: qsTr('Wallet details')
}
GridLayout {

View File

@@ -33,16 +33,8 @@ Pane {
Layout.preferredWidth: parent.width
Layout.margins: constants.paddingLarge
Label {
Heading {
text: qsTr('Wallets')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
Frame {

View File

@@ -0,0 +1,38 @@
import QtQuick 2.6
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.1
RowLayout {
id: root
property string text
property alias font: label.font
Layout.fillWidth: true
Layout.topMargin: constants.paddingMedium
Layout.bottomMargin: constants.paddingMedium
spacing: constants.paddingLarge
Rectangle {
color: constants.mutedForeground
height: 1
Layout.fillWidth: true
}
Label {
id: label
Layout.leftMargin: constants.paddingMedium
Layout.rightMargin: constants.paddingMedium
text: root.text
color: constants.mutedForeground
font.pixelSize: constants.fontSizeLarge
}
Rectangle {
color: constants.mutedForeground
height: 1
Layout.fillWidth: true
}
}

View File

@@ -2,34 +2,9 @@ import QtQuick 2.6
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.1
RowLayout {
Heading {
id: root
property string text
Layout.fillWidth: true
Layout.topMargin: constants.paddingXLarge
spacing: constants.paddingLarge
Rectangle {
color: constants.mutedForeground
height: 1
Layout.fillWidth: true
}
Label {
Layout.leftMargin: constants.paddingMedium
Layout.rightMargin: constants.paddingMedium
text: root.text
color: constants.mutedForeground
font.pixelSize: constants.fontSizeLarge
}
Rectangle {
color: constants.mutedForeground
height: 1
Layout.fillWidth: true
}
Layout.bottomMargin: constants.paddingMedium
}

View File

@@ -44,16 +44,8 @@ Item {
ColumnLayout {
Label {
Heading {
text: qsTr('Servers')
font.pixelSize: constants.fontSizeLarge
color: Material.accentColor
}
Rectangle {
Layout.fillWidth: true
height: 1
color: Material.accentColor
}
Frame {