Skip to content

Commit b80cbe7

Browse files
committed
Merge #203: Introducing the node settings views
6037471 qml: use node specific pages, introduce node settings (jarolrod) 6ac40e8 qml: entangle the About and Developer options pages (jarolrod) Pull request description: This introduces the views that would allow for [settings configuration](https://www.figma.com/file/GaCoOSNHB2yMB9ThiDtred/Bitcoin-Core-App?node-id=4588%3A101966&t=m6V59cZ2STeCRp1y-0) after the user has finished onboarding and the node has started to run. | NodeRuner | NodeSettings | | --------- | ------------ | | <img width="752" alt="Screen Shot 2022-12-10 at 12 58 07 AM" src="https://user-images.githubusercontent.com/23396902/206832668-0a5e469a-830f-4d7e-bfc5-0e6c115d74fd.png"> | <img width="752" alt="Screen Shot 2022-12-10 at 12 58 12 AM" src="https://user-images.githubusercontent.com/23396902/206832715-299234d4-6850-4dd3-956f-fd5bc47980c7.png"> | For several reasons this also entangles the About and Developer options and entangles them into their own independent SwipeView, which means that we only need to instantiate SettingsAbout. There isn't a use case for the Developer options to be shown independently. ### Follow-ups: - The caret-right icon used within the settings rows is too large because I'm just using NavButton, the width and height should be adjusted to match closer to what the design file [specifies](https://www.figma.com/file/GaCoOSNHB2yMB9ThiDtred/Bitcoin-Core-App?node-id=4588%3A101966&t=m6V59cZ2STeCRp1y-0) - This uses a StackView to move through the settings pages but on linux, the animation between pages isn't how we'd want it to be; it's fine on macOS. The animation should match our SwipeViews. Note: I didn't use SwipeView because while you can set an index to go to, it flips through all previous pages to get there which is visually distracting. [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/insecure_win_gui.zip?branch=pull/203) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/insecure_mac_gui.zip?branch=pull/203) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/insecure_mac_arm64_gui.zip?branch=pull/203) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/insecure_android_apk.zip?branch=pull/203) ACKs for top commit: johnny9: ACK 6037471 Tree-SHA512: 0dbf22abccded6786a9970b01ee4a7b70b25c03e29334a145ae6d261fe425343cc7ec60836e6fee565a2d40550d2749766c63ac0af285d92dad2c8d1a4bc1836
2 parents 1c865a1 + 6037471 commit b80cbe7

File tree

8 files changed

+222
-43
lines changed

8 files changed

+222
-43
lines changed

src/Makefile.qt.include

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ QML_RES_QML = \
344344
qml/controls/ValueInput.qml \
345345
qml/pages/initerrormessage.qml \
346346
qml/pages/main.qml \
347+
qml/pages/node/NodeRunner.qml \
348+
qml/pages/node/NodeSettings.qml \
347349
qml/pages/onboarding/OnboardingBlockclock.qml \
348350
qml/pages/onboarding/OnboardingConnection.qml \
349351
qml/pages/onboarding/OnboardingCover.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
<file>controls/ValueInput.qml</file>
2727
<file>pages/initerrormessage.qml</file>
2828
<file>pages/main.qml</file>
29+
<file>pages/node/NodeRunner.qml</file>
30+
<file>pages/node/NodeSettings.qml</file>
2931
<file>pages/onboarding/OnboardingBlockclock.qml</file>
3032
<file>pages/onboarding/OnboardingConnection.qml</file>
3133
<file>pages/onboarding/OnboardingCover.qml</file>

src/qml/components/AboutOptions.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ColumnLayout {
5656
icon.width: 18
5757
background: null
5858
onClicked: {
59-
introductions.incrementCurrentIndex()
59+
aboutSwipe.incrementCurrentIndex()
6060
}
6161
}
6262
}

src/qml/pages/main.qml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import QtQuick.Layouts 1.15
88
import "../components"
99
import "../controls"
1010
import "./onboarding"
11+
import "./node"
1112

1213
ApplicationWindow {
1314
id: appWindow
@@ -44,30 +45,29 @@ ApplicationWindow {
4445

4546
Component {
4647
id: node
47-
Page {
48+
SwipeView {
49+
id: node_swipe
4850
anchors.fill: parent
49-
background: null
50-
ColumnLayout {
51-
width: 600
52-
spacing: 0
53-
anchors.centerIn: parent
54-
Component.onCompleted: nodeModel.startNodeInitializionThread();
55-
Image {
56-
Layout.alignment: Qt.AlignCenter
57-
source: "image://images/app"
58-
sourceSize.width: 64
59-
sourceSize.height: 64
51+
interactive: false
52+
orientation: Qt.Vertical
53+
NodeRunner {
54+
navRightDetail: NavButton {
55+
iconSource: "image://images/gear"
56+
iconHeight: 24
57+
onClicked: node_swipe.incrementCurrentIndex()
6058
}
61-
BlockCounter {
62-
Layout.alignment: Qt.AlignCenter
63-
blockHeight: nodeModel.blockTipHeight
59+
}
60+
NodeSettings {
61+
navMiddleDetail: Header {
62+
bold: true
63+
headerSize: 18
64+
header: "Settings"
6465
}
65-
ProgressIndicator {
66-
width: 200
67-
Layout.alignment: Qt.AlignCenter
68-
progress: nodeModel.verificationProgress
66+
navRightDetail: NavButton {
67+
text: qsTr("Done")
68+
onClicked: node_swipe.decrementCurrentIndex()
6969
}
7070
}
71-
}
71+
}
7272
}
7373
}

src/qml/pages/node/NodeRunner.qml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright (c) 2022 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+
Page {
12+
background: null
13+
clip: true
14+
property alias navRightDetail: navbar.rightDetail
15+
header: NavigationBar {
16+
id: navbar
17+
}
18+
ColumnLayout {
19+
spacing: 0
20+
anchors.fill: parent
21+
ColumnLayout {
22+
width: 600
23+
spacing: 0
24+
anchors.centerIn: parent
25+
Component.onCompleted: nodeModel.startNodeInitializionThread();
26+
Image {
27+
Layout.alignment: Qt.AlignCenter
28+
source: "image://images/app"
29+
sourceSize.width: 64
30+
sourceSize.height: 64
31+
}
32+
BlockCounter {
33+
Layout.alignment: Qt.AlignCenter
34+
blockHeight: nodeModel.blockTipHeight
35+
}
36+
ProgressIndicator {
37+
width: 200
38+
Layout.alignment: Qt.AlignCenter
39+
progress: nodeModel.verificationProgress
40+
}
41+
}
42+
}
43+
}

src/qml/pages/node/NodeSettings.qml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// Copyright (c) 2022 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+
import "../settings"
11+
12+
Item {
13+
id: nodeSettings
14+
property alias navMiddleDetail: nodeSettingsView.navMiddleDetail
15+
property alias navRightDetail: nodeSettingsView.navRightDetail
16+
StackView {
17+
id: nodeSettingsView
18+
property alias navMiddleDetail: node_settings.navMiddleDetail
19+
property alias navRightDetail: node_settings.navRightDetail
20+
initialItem: Page {
21+
id: node_settings
22+
property alias navMiddleDetail: navbar.middleDetail
23+
property alias navRightDetail: navbar.rightDetail
24+
background: null
25+
header: NavigationBar {
26+
id: navbar
27+
}
28+
ColumnLayout {
29+
spacing: 0
30+
width: parent.width
31+
ColumnLayout {
32+
spacing: 20
33+
Layout.maximumWidth: 450
34+
Layout.topMargin: 30
35+
Layout.leftMargin: 20
36+
Layout.rightMargin: 20
37+
Layout.alignment: Qt.AlignCenter
38+
Setting {
39+
Layout.fillWidth: true
40+
header: qsTr("Dark Mode")
41+
actionItem: OptionSwitch {
42+
checked: Theme.dark
43+
onToggled: Theme.toggleDark()
44+
}
45+
}
46+
Setting {
47+
Layout.fillWidth: true
48+
header: qsTr("About")
49+
actionItem: NavButton {
50+
iconSource: "image://images/caret-right"
51+
background: null
52+
onClicked: {
53+
nodeSettingsView.push(about_page)
54+
}
55+
}
56+
}
57+
Setting {
58+
Layout.fillWidth: true
59+
header: qsTr("Storage")
60+
actionItem: NavButton {
61+
iconSource: "image://images/caret-right"
62+
background: null
63+
onClicked: {
64+
nodeSettingsView.push(storage_page)
65+
}
66+
}
67+
}
68+
Setting {
69+
Layout.fillWidth: true
70+
header: qsTr("Connection")
71+
actionItem: NavButton {
72+
iconSource: "image://images/caret-right"
73+
background: null
74+
onClicked: {
75+
nodeSettingsView.push(connection_page)
76+
}
77+
}
78+
}
79+
}
80+
}
81+
}
82+
anchors.fill: parent
83+
}
84+
Component {
85+
id: about_page
86+
SettingsAbout {
87+
navLeftDetail: NavButton {
88+
iconSource: "image://images/caret-left"
89+
text: qsTr("Back")
90+
onClicked: {
91+
nodeSettingsView.pop()
92+
}
93+
}
94+
}
95+
}
96+
Component {
97+
id: storage_page
98+
SettingsStorage {
99+
navLeftDetail: NavButton {
100+
iconSource: "image://images/caret-left"
101+
text: qsTr("Back")
102+
onClicked: {
103+
nodeSettingsView.pop()
104+
}
105+
}
106+
}
107+
}
108+
Component {
109+
id: connection_page
110+
SettingsConnection {
111+
navLeftDetail: NavButton {
112+
iconSource: "image://images/caret-left"
113+
text: qsTr("Back")
114+
onClicked: {
115+
nodeSettingsView.pop()
116+
}
117+
}
118+
}
119+
}
120+
}

src/qml/pages/onboarding/OnboardingCover.qml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,5 @@ Page {
5252
}
5353
}
5454
}
55-
SettingsDeveloper {
56-
navLeftDetail: NavButton {
57-
iconSource: "image://images/caret-left"
58-
text: qsTr("Back")
59-
onClicked: {
60-
introductions.decrementCurrentIndex()
61-
}
62-
}
63-
}
6455
}
6556
}

src/qml/pages/settings/SettingsAbout.qml

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,40 @@ import QtQuick.Layouts 1.15
88
import "../../controls"
99
import "../../components"
1010

11-
InformationPage {
12-
bannerActive: false
13-
bold: true
14-
headerText: qsTr("About")
15-
headerMargin: 0
16-
description: qsTr("Bitcoin Core is an open source project.\nIf you find it useful, please contribute.\n\n This is experimental software.")
17-
descriptionMargin: 20
18-
detailActive: true
19-
detailItem: ColumnLayout {
20-
spacing: 0
21-
AboutOptions {
22-
Layout.maximumWidth: 450
23-
Layout.alignment: Qt.AlignCenter
11+
Item {
12+
property alias navLeftDetail: aboutSwipe.navLeftDetail
13+
SwipeView {
14+
id: aboutSwipe
15+
property alias navLeftDetail: about_settings.navLeftDetail
16+
anchors.fill: parent
17+
interactive: false
18+
orientation: Qt.Horizontal
19+
InformationPage {
20+
id: about_settings
21+
bannerActive: false
22+
bannerMargin: 0
23+
bold: true
24+
headerText: qsTr("About")
25+
headerMargin: 0
26+
description: qsTr("Bitcoin Core is an open source project.\nIf you find it useful, please contribute.\n\n This is experimental software.")
27+
descriptionMargin: 20
28+
detailActive: true
29+
detailItem: ColumnLayout {
30+
spacing: 0
31+
AboutOptions {
32+
Layout.maximumWidth: 450
33+
Layout.alignment: Qt.AlignCenter
34+
}
35+
}
36+
}
37+
SettingsDeveloper {
38+
navLeftDetail: NavButton {
39+
iconSource: "image://images/caret-left"
40+
text: qsTr("Back")
41+
onClicked: {
42+
aboutSwipe.decrementCurrentIndex()
43+
}
44+
}
2445
}
2546
}
2647
}

0 commit comments

Comments
 (0)