Skip to content

Separate out Separator from Setting control #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ QML_RES_QML = \
qml/components/DeveloperOptions.qml \
qml/components/PeersIndicator.qml \
qml/components/NetworkIndicator.qml \
qml/components/Separator.qml \
qml/components/StorageLocations.qml \
qml/components/StorageOptions.qml \
qml/components/StorageSettings.qml \
Expand Down
1 change: 1 addition & 0 deletions src/qml/bitcoin_qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<file>components/DeveloperOptions.qml</file>
<file>components/NetworkIndicator.qml</file>
<file>components/StorageLocations.qml</file>
<file>components/Separator.qml</file>
<file>components/StorageOptions.qml</file>
<file>components/StorageSettings.qml</file>
<file>controls/ContinueButton.qml</file>
Expand Down
6 changes: 5 additions & 1 deletion src/qml/components/AboutOptions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import QtQuick.Layouts 1.15
import "../controls"

ColumnLayout {
spacing: 20
spacing: 4
Setting {
id: websiteLink
Layout.fillWidth: true
Expand All @@ -20,6 +20,7 @@ ColumnLayout {
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: sourceLink
Layout.fillWidth: true
Expand All @@ -31,6 +32,7 @@ ColumnLayout {
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: licenseLink
Layout.fillWidth: true
Expand All @@ -42,6 +44,7 @@ ColumnLayout {
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: versionLink
Layout.fillWidth: true
Expand All @@ -56,6 +59,7 @@ ColumnLayout {
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoDeveloper
Layout.fillWidth: true
Expand Down
6 changes: 5 additions & 1 deletion src/qml/components/ConnectionSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import QtQuick.Layouts 1.15
import "../controls"

ColumnLayout {
spacing: 20
spacing: 4
Setting {
Layout.fillWidth: true
header: qsTr("Enable listening")
Expand All @@ -22,6 +22,7 @@ ColumnLayout {
loadedItem.toggled()
}
}
Separator { Layout.fillWidth: true }
Setting {
Layout.fillWidth: true
header: qsTr("Map port using UPnP")
Expand All @@ -34,6 +35,7 @@ ColumnLayout {
loadedItem.toggled()
}
}
Separator { Layout.fillWidth: true }
Setting {
Layout.fillWidth: true
header: qsTr("Map port using NAT-PMP")
Expand All @@ -46,6 +48,7 @@ ColumnLayout {
loadedItem.toggled()
}
}
Separator { Layout.fillWidth: true }
Setting {
Layout.fillWidth: true
header: qsTr("Enable RPC server")
Expand All @@ -58,6 +61,7 @@ ColumnLayout {
loadedItem.toggled()
}
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoProxy
last: true
Expand Down
5 changes: 4 additions & 1 deletion src/qml/components/DeveloperOptions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import QtQuick.Layouts 1.15
import "../controls"

ColumnLayout {
spacing: 20
spacing: 4
Setting {
id: devDocsLink
Layout.fillWidth: true
Expand All @@ -22,6 +22,7 @@ ColumnLayout {
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: dbcacheSetting
Layout.fillWidth: true
Expand All @@ -33,6 +34,7 @@ ColumnLayout {
}
onClicked: loadedItem.forceActiveFocus()
}
Separator { Layout.fillWidth: true }
Setting {
id: parSetting
Layout.fillWidth: true
Expand All @@ -44,6 +46,7 @@ ColumnLayout {
}
onClicked: loadedItem.forceActiveFocus()
}
Separator { Layout.fillWidth: true }
Setting {
Layout.fillWidth: true
header: qsTr("Dark Mode")
Expand Down
12 changes: 12 additions & 0 deletions src/qml/components/Separator.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) 2023 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

import QtQuick 2.15
import QtQuick.Controls 2.15
import "../controls"

Rectangle {
height: 1
color: Theme.color.neutral5
}
3 changes: 2 additions & 1 deletion src/qml/components/StorageSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import QtQuick.Layouts 1.15
import "../controls"

ColumnLayout {
spacing: 20
spacing: 4
Setting {
Layout.fillWidth: true
header: qsTr("Store recent blocks only")
Expand All @@ -21,6 +21,7 @@ ColumnLayout {
loadedItem.toggled()
}
}
Separator { Layout.fillWidth: true }
Setting {
id: pruneTargetSetting
Layout.fillWidth: true
Expand Down
42 changes: 15 additions & 27 deletions src/qml/controls/Setting.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,24 @@ AbstractButton {
}
}

contentItem: ColumnLayout {
spacing: 20
width: parent.width
RowLayout {
Header {
Layout.fillWidth: true
center: false
header: root.header
headerSize: 18
headerColor: root.stateColor
description: root.description
descriptionSize: 15
descriptionMargin: 0
}
Loader {
id: action_loader
active: true
visible: active
sourceComponent: root.actionItem
}
contentItem: RowLayout {
Header {
Layout.topMargin: 14
Layout.bottomMargin: 14
Layout.fillWidth: true
center: false
header: root.header
headerSize: 18
headerColor: root.stateColor
description: root.description
descriptionSize: 15
descriptionMargin: 0
}
Loader {
Layout.fillWidth: true
Layout.columnSpan: 2
active: !last
id: action_loader
active: true
visible: active
sourceComponent: Rectangle {
height: 1
color: Theme.color.neutral5
}
sourceComponent: root.actionItem
}
}
}
5 changes: 4 additions & 1 deletion src/qml/pages/node/NodeSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Item {
id: navbar
}
ColumnLayout {
spacing: 20
spacing: 4
width: Math.min(parent.width, 450)
anchors.horizontalCenter: parent.horizontalCenter
Setting {
Expand All @@ -46,6 +46,7 @@ Item {
}
onClicked: loadedItem.toggled()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoAbout
Layout.fillWidth: true
Expand All @@ -58,6 +59,7 @@ Item {
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoStorage
Layout.fillWidth: true
Expand All @@ -70,6 +72,7 @@ Item {
}
onClicked: loadedItem.clicked()
}
Separator { Layout.fillWidth: true }
Setting {
id: gotoConnection
Layout.fillWidth: true
Expand Down