Skip to content

Commit 5cbf67f

Browse files
committed
qml: use Separator component to separate settings
Extracts out the Separator from the Setting control. Adjusts relevant pages ColumnLayout spacing values. Additionally, adds proper margin values to header since we no longer have spacing provided by a ColumnLayout inside of the Setting control.
1 parent 09aa701 commit 5cbf67f

File tree

6 files changed

+35
-32
lines changed

6 files changed

+35
-32
lines changed

src/qml/components/AboutOptions.qml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import QtQuick.Layouts 1.15
88
import "../controls"
99

1010
ColumnLayout {
11-
spacing: 20
11+
spacing: 4
1212
Setting {
1313
id: websiteLink
1414
Layout.fillWidth: true
@@ -20,6 +20,7 @@ ColumnLayout {
2020
}
2121
onClicked: loadedItem.clicked()
2222
}
23+
Separator { Layout.fillWidth: true }
2324
Setting {
2425
id: sourceLink
2526
Layout.fillWidth: true
@@ -31,6 +32,7 @@ ColumnLayout {
3132
}
3233
onClicked: loadedItem.clicked()
3334
}
35+
Separator { Layout.fillWidth: true }
3436
Setting {
3537
id: licenseLink
3638
Layout.fillWidth: true
@@ -42,6 +44,7 @@ ColumnLayout {
4244
}
4345
onClicked: loadedItem.clicked()
4446
}
47+
Separator { Layout.fillWidth: true }
4548
Setting {
4649
id: versionLink
4750
Layout.fillWidth: true
@@ -56,6 +59,7 @@ ColumnLayout {
5659
}
5760
onClicked: loadedItem.clicked()
5861
}
62+
Separator { Layout.fillWidth: true }
5963
Setting {
6064
id: gotoDeveloper
6165
Layout.fillWidth: true

src/qml/components/ConnectionSettings.qml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import QtQuick.Layouts 1.15
88
import "../controls"
99

1010
ColumnLayout {
11-
spacing: 20
11+
spacing: 4
1212
Setting {
1313
Layout.fillWidth: true
1414
header: qsTr("Enable listening")
@@ -22,6 +22,7 @@ ColumnLayout {
2222
loadedItem.toggled()
2323
}
2424
}
25+
Separator { Layout.fillWidth: true }
2526
Setting {
2627
Layout.fillWidth: true
2728
header: qsTr("Map port using UPnP")
@@ -34,6 +35,7 @@ ColumnLayout {
3435
loadedItem.toggled()
3536
}
3637
}
38+
Separator { Layout.fillWidth: true }
3739
Setting {
3840
Layout.fillWidth: true
3941
header: qsTr("Map port using NAT-PMP")
@@ -46,6 +48,7 @@ ColumnLayout {
4648
loadedItem.toggled()
4749
}
4850
}
51+
Separator { Layout.fillWidth: true }
4952
Setting {
5053
Layout.fillWidth: true
5154
header: qsTr("Enable RPC server")
@@ -58,6 +61,7 @@ ColumnLayout {
5861
loadedItem.toggled()
5962
}
6063
}
64+
Separator { Layout.fillWidth: true }
6165
Setting {
6266
id: gotoProxy
6367
last: true

src/qml/components/DeveloperOptions.qml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import QtQuick.Layouts 1.15
88
import "../controls"
99

1010
ColumnLayout {
11-
spacing: 20
11+
spacing: 4
1212
Setting {
1313
id: devDocsLink
1414
Layout.fillWidth: true
@@ -22,6 +22,7 @@ ColumnLayout {
2222
}
2323
onClicked: loadedItem.clicked()
2424
}
25+
Separator { Layout.fillWidth: true }
2526
Setting {
2627
id: dbcacheSetting
2728
Layout.fillWidth: true
@@ -33,6 +34,7 @@ ColumnLayout {
3334
}
3435
onClicked: loadedItem.forceActiveFocus()
3536
}
37+
Separator { Layout.fillWidth: true }
3638
Setting {
3739
id: parSetting
3840
Layout.fillWidth: true
@@ -44,6 +46,7 @@ ColumnLayout {
4446
}
4547
onClicked: loadedItem.forceActiveFocus()
4648
}
49+
Separator { Layout.fillWidth: true }
4750
Setting {
4851
Layout.fillWidth: true
4952
header: qsTr("Dark Mode")

src/qml/components/StorageSettings.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import QtQuick.Layouts 1.15
88
import "../controls"
99

1010
ColumnLayout {
11-
spacing: 20
11+
spacing: 4
1212
Setting {
1313
Layout.fillWidth: true
1414
header: qsTr("Store recent blocks only")
@@ -21,6 +21,7 @@ ColumnLayout {
2121
loadedItem.toggled()
2222
}
2323
}
24+
Separator { Layout.fillWidth: true }
2425
Setting {
2526
id: pruneTargetSetting
2627
Layout.fillWidth: true

src/qml/controls/Setting.qml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,36 +50,24 @@ AbstractButton {
5050
}
5151
}
5252

53-
contentItem: ColumnLayout {
54-
spacing: 20
55-
width: parent.width
56-
RowLayout {
57-
Header {
58-
Layout.fillWidth: true
59-
center: false
60-
header: root.header
61-
headerSize: 18
62-
headerColor: root.stateColor
63-
description: root.description
64-
descriptionSize: 15
65-
descriptionMargin: 0
66-
}
67-
Loader {
68-
id: action_loader
69-
active: true
70-
visible: active
71-
sourceComponent: root.actionItem
72-
}
53+
contentItem: RowLayout {
54+
Header {
55+
Layout.topMargin: 14
56+
Layout.bottomMargin: 14
57+
Layout.fillWidth: true
58+
center: false
59+
header: root.header
60+
headerSize: 18
61+
headerColor: root.stateColor
62+
description: root.description
63+
descriptionSize: 15
64+
descriptionMargin: 0
7365
}
7466
Loader {
75-
Layout.fillWidth: true
76-
Layout.columnSpan: 2
77-
active: !last
67+
id: action_loader
68+
active: true
7869
visible: active
79-
sourceComponent: Rectangle {
80-
height: 1
81-
color: Theme.color.neutral5
82-
}
70+
sourceComponent: root.actionItem
8371
}
8472
}
8573
}

src/qml/pages/node/NodeSettings.qml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Item {
3434
id: navbar
3535
}
3636
ColumnLayout {
37-
spacing: 20
37+
spacing: 4
3838
width: Math.min(parent.width, 450)
3939
anchors.horizontalCenter: parent.horizontalCenter
4040
Setting {
@@ -46,6 +46,7 @@ Item {
4646
}
4747
onClicked: loadedItem.toggled()
4848
}
49+
Separator { Layout.fillWidth: true }
4950
Setting {
5051
id: gotoAbout
5152
Layout.fillWidth: true
@@ -58,6 +59,7 @@ Item {
5859
}
5960
onClicked: loadedItem.clicked()
6061
}
62+
Separator { Layout.fillWidth: true }
6163
Setting {
6264
id: gotoStorage
6365
Layout.fillWidth: true
@@ -70,6 +72,7 @@ Item {
7072
}
7173
onClicked: loadedItem.clicked()
7274
}
75+
Separator { Layout.fillWidth: true }
7376
Setting {
7477
id: gotoConnection
7578
Layout.fillWidth: true

0 commit comments

Comments
 (0)