Skip to content

Commit 410b135

Browse files
committed
qml: introduce Display Settings page
1 parent 6b824db commit 410b135

File tree

5 files changed

+125
-9
lines changed

5 files changed

+125
-9
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ QML_RES_QML = \
393393
qml/pages/settings/SettingsBlockClockDisplayMode.qml \
394394
qml/pages/settings/SettingsConnection.qml \
395395
qml/pages/settings/SettingsDeveloper.qml \
396+
qml/pages/settings/SettingsDisplay.qml \
396397
qml/pages/settings/SettingsProxy.qml \
397398
qml/pages/settings/SettingsStorage.qml \
398399
qml/pages/settings/SettingsTheme.qml

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
<file>pages/settings/SettingsBlockClockDisplayMode.qml</file>
5555
<file>pages/settings/SettingsConnection.qml</file>
5656
<file>pages/settings/SettingsDeveloper.qml</file>
57+
<file>pages/settings/SettingsDisplay.qml</file>
5758
<file>pages/settings/SettingsProxy.qml</file>
5859
<file>pages/settings/SettingsStorage.qml</file>
5960
<file>pages/settings/SettingsTheme.qml</file>

src/qml/controls/Theme.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Control {
1212

1313
Settings {
1414
id: settings
15+
property alias dark: root.dark
1516
property alias blockclocksize: root.blockclocksize
1617
}
1718

src/qml/pages/node/NodeSettings.qml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,26 @@ Item {
3838
width: Math.min(parent.width, 450)
3939
anchors.horizontalCenter: parent.horizontalCenter
4040
Setting {
41+
id: gotoAbout
4142
Layout.fillWidth: true
42-
header: qsTr("Dark Mode")
43-
actionItem: OptionSwitch {
44-
checked: Theme.dark
45-
onToggled: Theme.toggleDark()
43+
header: qsTr("About")
44+
actionItem: CaretRightButton {
45+
stateColor: gotoAbout.stateColor
46+
onClicked: {
47+
nodeSettingsView.push(about_page)
48+
}
4649
}
47-
onClicked: loadedItem.toggled()
50+
onClicked: loadedItem.clicked()
4851
}
4952
Separator { Layout.fillWidth: true }
5053
Setting {
51-
id: gotoAbout
54+
id: gotoDisplay
5255
Layout.fillWidth: true
53-
header: qsTr("About")
56+
header: qsTr("Display")
5457
actionItem: CaretRightButton {
55-
stateColor: gotoAbout.stateColor
58+
stateColor: gotoDisplay.stateColor
5659
onClicked: {
57-
nodeSettingsView.push(about_page)
60+
nodeSettingsView.push(display_page)
5861
}
5962
}
6063
onClicked: loadedItem.clicked()
@@ -127,6 +130,18 @@ Item {
127130
}
128131
}
129132
}
133+
Component {
134+
id: display_page
135+
SettingsDisplay {
136+
navLeftDetail: NavButton {
137+
iconSource: "image://images/caret-left"
138+
text: qsTr("Back")
139+
onClicked: {
140+
nodeSettingsView.pop()
141+
}
142+
}
143+
}
144+
}
130145
Component {
131146
id: storage_page
132147
SettingsStorage {
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// Copyright (c) 2023 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
import QtQuick 2.15
6+
import QtQuick.Controls 2.15
7+
import QtQuick.Layouts 1.15
8+
import "../../controls"
9+
import "../../components"
10+
11+
Item {
12+
property alias navLeftDetail: displaySettingsView.navLeftDetail
13+
StackView {
14+
id: displaySettingsView
15+
property alias navLeftDetail: displaySettings.navLeftDetail
16+
property bool newcompilebool: false
17+
anchors.fill: parent
18+
19+
20+
initialItem: Page {
21+
id: displaySettings
22+
property alias navLeftDetail: navbar.leftDetail
23+
background: null
24+
implicitWidth: 450
25+
leftPadding: 20
26+
rightPadding: 20
27+
topPadding: 30
28+
29+
header: NavigationBar {
30+
id: navbar
31+
}
32+
ColumnLayout {
33+
spacing: 4
34+
width: Math.min(parent.width, 450)
35+
anchors.horizontalCenter: parent.horizontalCenter
36+
Setting {
37+
id: gotoTheme
38+
Layout.fillWidth: true
39+
header: qsTr("Theme")
40+
actionItem: CaretRightButton {
41+
stateColor: gotoTheme.stateColor
42+
onClicked: {
43+
nodeSettingsView.push(theme_page)
44+
}
45+
}
46+
onClicked: loadedItem.clicked()
47+
}
48+
Separator { Layout.fillWidth: true }
49+
Setting {
50+
id: gotoBlockClockSize
51+
Layout.fillWidth: true
52+
header: qsTr("Block clock display mode")
53+
actionItem: CaretRightButton {
54+
stateColor: gotoBlockClockSize.stateColor
55+
onClicked: {
56+
nodeSettingsView.push(blockclocksize_page)
57+
}
58+
}
59+
onClicked: loadedItem.clicked()
60+
}
61+
}
62+
}
63+
}
64+
Component {
65+
id: theme_page
66+
SettingsTheme {
67+
navLeftDetail: NavButton {
68+
iconSource: "image://images/caret-left"
69+
text: qsTr("Back")
70+
onClicked: {
71+
nodeSettingsView.pop()
72+
}
73+
}
74+
navMiddleDetail: Header {
75+
headerBold: true
76+
headerSize: 18
77+
header: qsTr("Theme")
78+
}
79+
}
80+
}
81+
Component {
82+
id: blockclocksize_page
83+
SettingsBlockClockDisplayMode {
84+
navLeftDetail: NavButton {
85+
iconSource: "image://images/caret-left"
86+
text: qsTr("Back")
87+
onClicked: {
88+
nodeSettingsView.pop()
89+
}
90+
}
91+
navMiddleDetail: Header {
92+
headerBold: true
93+
headerSize: 18
94+
header: qsTr("Block clock display mode")
95+
}
96+
}
97+
}
98+
}

0 commit comments

Comments
 (0)