Skip to content

Introducing Reusable Setting Views #197

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 3 commits into from
Dec 9, 2022
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
11 changes: 4 additions & 7 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,15 @@ QML_RES_QML = \
qml/pages/initerrormessage.qml \
qml/pages/main.qml \
qml/pages/onboarding/onboarding01.qml \
qml/pages/onboarding/onboarding01a.qml \
qml/pages/onboarding/onboarding01b.qml \
qml/pages/onboarding/onboarding01c.qml \
qml/pages/onboarding/onboarding02.qml \
qml/pages/onboarding/onboarding03.qml \
qml/pages/onboarding/onboarding04.qml \
qml/pages/onboarding/onboarding05.qml \
qml/pages/onboarding/onboarding05a.qml \
qml/pages/onboarding/onboarding05b.qml \
qml/pages/onboarding/onboarding06.qml \
qml/pages/onboarding/onboarding06a.qml \
qml/pages/onboarding/onboarding06b.qml
qml/pages/settings/SettingsAbout.qml \
qml/pages/settings/SettingsConnection.qml \
qml/pages/settings/SettingsDeveloper.qml \
qml/pages/settings/SettingsStorage.qml

BITCOIN_QT_CPP = $(BITCOIN_QT_BASE_CPP)
if TARGET_WINDOWS
Expand Down
11 changes: 4 additions & 7 deletions src/qml/bitcoin_qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,15 @@
<file>pages/initerrormessage.qml</file>
<file>pages/main.qml</file>
<file>pages/onboarding/onboarding01.qml</file>
<file>pages/onboarding/onboarding01a.qml</file>
<file>pages/onboarding/onboarding01b.qml</file>
<file>pages/onboarding/onboarding01c.qml</file>
<file>pages/onboarding/onboarding02.qml</file>
<file>pages/onboarding/onboarding03.qml</file>
<file>pages/onboarding/onboarding04.qml</file>
<file>pages/onboarding/onboarding05.qml</file>
<file>pages/onboarding/onboarding05a.qml</file>
<file>pages/onboarding/onboarding05b.qml</file>
<file>pages/onboarding/onboarding06.qml</file>
<file>pages/onboarding/onboarding06a.qml</file>
<file>pages/onboarding/onboarding06b.qml</file>
<file>pages/settings/SettingsAbout.qml</file>
<file>pages/settings/SettingsConnection.qml</file>
<file>pages/settings/SettingsDeveloper.qml</file>
<file>pages/settings/SettingsStorage.qml</file>
</qresource>
<qresource prefix="/icons">
<file alias="arrow-down">res/icons/arrow-down.png</file>
Expand Down
52 changes: 46 additions & 6 deletions src/qml/pages/onboarding/onboarding01.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import "../../controls"
import "../../components"
import "../settings"

Page {
background: null
Expand All @@ -17,14 +18,53 @@ Page {
anchors.fill: parent
interactive: false
orientation: Qt.Horizontal
Loader {
source:"onboarding01a.qml"
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

@johnny9 johnny9 Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SwipeViews don't handle Layout properties. Think this can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for spotting these, it's a bad habit of mine to place this until the view is working correctly. Since you've already opened a PR to address them, i've left this as is.

navRightDetail: NavButton {
iconSource: "image://images/info"
iconHeight: 24
onClicked: {
introductions.incrementCurrentIndex()
swipeView.inSubPage = true
}
}
bannerItem: Image {
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
source: "image://images/app"
// Bitcoin icon has ~11% padding
sourceSize.width: 112
sourceSize.height: 112
}
bannerMargin: 0
bold: true
headerText: qsTr("Bitcoin Core App")
headerSize: 36
description: qsTr("Be part of the Bitcoin network.")
descriptionMargin: 10
descriptionSize: 24
subtext: qsTr("100% open-source & open-design")
buttonText: qsTr("Start")
}
Loader {
source:"onboarding01b.qml"
SettingsAbout {
navLeftDetail: NavButton {
iconSource: "image://images/caret-left"
text: qsTr("Back")
onClicked: {
introductions.decrementCurrentIndex()
swipeView.inSubPage = false
}
}
}
Loader {
source:"onboarding01c.qml"
SettingsDeveloper {
navLeftDetail: NavButton {
iconSource: "image://images/caret-left"
text: qsTr("Back")
onClicked: {
introductions.decrementCurrentIndex()
swipeView.inSubPage = true
}
}
}
}
}
40 changes: 0 additions & 40 deletions src/qml/pages/onboarding/onboarding01a.qml

This file was deleted.

46 changes: 42 additions & 4 deletions src/qml/pages/onboarding/onboarding05.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import "../../controls"
import "../../components"
import "../settings"

Page {
background: null
Expand All @@ -17,11 +18,48 @@ Page {
anchors.fill: parent
interactive: false
orientation: Qt.Vertical
Loader {
source:"onboarding05a.qml"
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

navLeftDetail: NavButton {
iconSource: "image://images/caret-left"
text: qsTr("Back")
onClicked: swipeView.decrementCurrentIndex()
}
bannerActive: false
bold: true
headerText: qsTr("Storage")
headerMargin: 0
description: qsTr("Data retrieved from the Bitcoin network is stored on your device.\nYou have 500GB of storage available.")
descriptionMargin: 10
detailActive: true
detailItem: ColumnLayout {
spacing: 0
StorageOptions {
Layout.maximumWidth: 450
Layout.alignment: Qt.AlignCenter
}
TextButton {
Layout.topMargin: 30
Layout.fillWidth: true
text: qsTr("Detailed settings")
textSize: 18
textColor: "#F7931A"
onClicked: {
storages.incrementCurrentIndex()
swipeView.inSubPage = true
}
}
}
buttonText: qsTr("Next")
}
Loader {
source:"onboarding05b.qml"
SettingsStorage {
navRightDetail: NavButton {
text: qsTr("Done")
onClicked: {
storages.decrementCurrentIndex()
swipeView.inSubPage = false
}
}
}
}
}
45 changes: 0 additions & 45 deletions src/qml/pages/onboarding/onboarding05a.qml

This file was deleted.

44 changes: 40 additions & 4 deletions src/qml/pages/onboarding/onboarding06.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import "../../controls"
import "../../components"
import "../settings"

Page {
background: null
Expand All @@ -17,11 +18,46 @@ Page {
anchors.fill: parent
interactive: false
orientation: Qt.Vertical
Loader {
source:"onboarding06a.qml"
InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

navLeftDetail: NavButton {
iconSource: "image://images/caret-left"
text: qsTr("Back")
onClicked: swipeView.decrementCurrentIndex()
}
bannerItem: Image {
Layout.topMargin: 20
Layout.alignment: Qt.AlignCenter
source: Theme.image.storage
sourceSize.width: 200
sourceSize.height: 200
}
bold: true
headerText: qsTr("Starting initial download")
headerMargin: 30
description: qsTr("The application will connect to the Bitcoin network and start downloading and verifying transactions.\n\nThis may take several hours, or even days, based on your connection.")
descriptionMargin: 20
detailActive: true
detailItem: TextButton {
text: qsTr("Connection settings")
textSize: 18
textColor: Theme.color.orange
onClicked: {
connections.incrementCurrentIndex()
swipeView.inSubPage = true
}
}
lastPage: true
buttonText: qsTr("Next")
}
Loader {
source:"onboarding06b.qml"
SettingsConnection {
navRightDetail: NavButton {
text: qsTr("Done")
onClicked: {
connections.decrementCurrentIndex()
swipeView.inSubPage = false
}
}
}
}
}
43 changes: 0 additions & 43 deletions src/qml/pages/onboarding/onboarding06a.qml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ import "../../components"

InformationPage {
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

navLeftDetail: NavButton {
iconSource: "image://images/caret-left"
text: qsTr("Back")
onClicked: {
introductions.decrementCurrentIndex()
swipeView.inSubPage = false
}
}
bannerActive: false
bold: true
headerText: qsTr("About")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ InformationPage {
background: null
Layout.fillWidth: true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

clip: true
navRightDetail: NavButton {
text: qsTr("Done")
onClicked: {
connections.decrementCurrentIndex()
swipeView.inSubPage = false
}
}
bannerActive: false
bold: true
headerText: qsTr("Connection settings")
Expand Down
Loading