Browse Source

qml: define a common Heading component for page section headings

master
Sander van Grieken 3 years ago
parent
commit
b7964253a8
  1. 15
      electrum/gui/qml/components/Addresses.qml
  2. 11
      electrum/gui/qml/components/ChannelDetails.qml
  3. 11
      electrum/gui/qml/components/Channels.qml
  4. 10
      electrum/gui/qml/components/Invoices.qml
  5. 11
      electrum/gui/qml/components/LightningPaymentDetails.qml
  6. 33
      electrum/gui/qml/components/NetworkOverview.qml
  7. 11
      electrum/gui/qml/components/TxDetails.qml
  8. 21
      electrum/gui/qml/components/WalletDetails.qml
  9. 10
      electrum/gui/qml/components/Wallets.qml
  10. 38
      electrum/gui/qml/components/controls/Heading.qml
  11. 29
      electrum/gui/qml/components/controls/PrefsHeading.qml
  12. 10
      electrum/gui/qml/components/controls/ServerConfig.qml

15
electrum/gui/qml/components/Addresses.qml

@ -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')
}
}
}

11
electrum/gui/qml/components/ChannelDetails.qml

@ -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 {

11
electrum/gui/qml/components/Channels.qml

@ -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 {

10
electrum/gui/qml/components/Invoices.qml

@ -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 {

11
electrum/gui/qml/components/LightningPaymentDetails.qml

@ -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 {

33
electrum/gui/qml/components/NetworkOverview.qml

@ -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 {

11
electrum/gui/qml/components/TxDetails.qml

@ -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 {

21
electrum/gui/qml/components/WalletDetails.qml

@ -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 {

10
electrum/gui/qml/components/Wallets.qml

@ -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 {

38
electrum/gui/qml/components/controls/Heading.qml

@ -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
}
}

29
electrum/gui/qml/components/controls/PrefsHeading.qml

@ -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
}

10
electrum/gui/qml/components/controls/ServerConfig.qml

@ -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 {

Loading…
Cancel
Save