qml: define a common Heading component for page section headings
This commit is contained in:
38
electrum/gui/qml/components/controls/Heading.qml
Normal file
38
electrum/gui/qml/components/controls/Heading.qml
Normal 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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user