Skip to content

Commit 0266742

Browse files
committed
qml: Introduce AddWallet page after onboarding
1 parent 931d442 commit 0266742

File tree

7 files changed

+131
-0
lines changed

7 files changed

+131
-0
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ QML_RES_FONTS = \
317317
qml/res/fonts/Inter-SemiBold.otf
318318

319319
QML_RES_ICONS = \
320+
qml/res/icons/add-wallet-dark.png \
320321
qml/res/icons/arrow-down.png \
321322
qml/res/icons/arrow-up.png \
322323
qml/res/icons/bitcoin-circle.png \

src/qml/bitcoin_qml.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@
6565
<file>pages/settings/SettingsProxy.qml</file>
6666
<file>pages/settings/SettingsStorage.qml</file>
6767
<file>pages/settings/SettingsTheme.qml</file>
68+
<file>pages/wallet/AddWallet.qml</file>
6869
<file>pages/wallet/DesktopWallets.qml</file>
6970
</qresource>
7071
<qresource prefix="/icons">
72+
<file alias="add-wallet-dark">res/icons/add-wallet-dark.png</file>
7173
<file alias="arrow-down">res/icons/arrow-down.png</file>
7274
<file alias="arrow-up">res/icons/arrow-up.png</file>
7375
<file alias="bitcoin-circle">res/icons/bitcoin-circle.png</file>

src/qml/imageprovider.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,25 @@ QPixmap ImageProvider::requestPixmap(const QString& id, QSize* size, const QSize
142142
return QIcon(":/icons/tooltip-arrow-light").pixmap(requested_size);
143143
}
144144

145+
if (id == "add-wallet-dark") {
146+
*size = requested_size;
147+
return QIcon(":/icons/add-wallet-dark").pixmap(requested_size);
148+
}
149+
150+
if (id == "wallet") {
151+
*size = requested_size;
152+
return QIcon(":/icons/wallet").pixmap(requested_size);
153+
}
154+
155+
if (id == "visible") {
156+
*size = requested_size;
157+
return QIcon(":/icons/visible").pixmap(requested_size);
158+
}
159+
160+
if (id == "hidden") {
161+
*size = requested_size;
162+
return QIcon(":/icons/hidden").pixmap(requested_size);
163+
}
164+
145165
return {};
146166
}

src/qml/pages/main.qml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ ApplicationWindow {
8181
optionsModel.onboard()
8282
if (AppMode.walletEnabled && AppMode.isDesktop) {
8383
main.push(desktopWallets)
84+
main.push(addWallet)
8485
} else {
8586
main.push(node)
8687
}
@@ -93,6 +94,15 @@ ApplicationWindow {
9394
DesktopWallets {}
9495
}
9596

97+
Component {
98+
id: addWallet
99+
AddWallet {
100+
onFinished: {
101+
main.pop()
102+
}
103+
}
104+
}
105+
96106
Component {
97107
id: shutdown
98108
Shutdown {}

src/qml/pages/wallet/AddWallet.qml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Copyright (c) 2024 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+
import "../wallet"
12+
13+
StackView {
14+
id: addWalletStack
15+
16+
signal finished()
17+
18+
initialItem: Page {
19+
background: null
20+
21+
header: NavigationBar2 {
22+
id: navbar
23+
rightItem: NavButton {
24+
text: qsTr("Skip")
25+
onClicked: {
26+
addWalletStack.finished()
27+
}
28+
}
29+
}
30+
31+
ColumnLayout {
32+
id: columnLayout
33+
width: Math.min(parent.width, 450)
34+
anchors.horizontalCenter: parent.horizontalCenter
35+
36+
Image {
37+
Layout.alignment: Qt.AlignCenter
38+
source: "image://images/add-wallet-dark"
39+
40+
sourceSize.width: 200
41+
sourceSize.height: 200
42+
}
43+
44+
Header {
45+
Layout.fillWidth: true
46+
Layout.leftMargin: 20
47+
Layout.rightMargin: 20
48+
header: qsTr("Add a wallet")
49+
description: qsTr("In this early stage of development, only wallet.dat files are supported.")
50+
}
51+
52+
ContinueButton {
53+
Layout.preferredWidth: Math.min(300, parent.width - 2 * Layout.leftMargin)
54+
Layout.topMargin: 40
55+
Layout.leftMargin: 20
56+
Layout.rightMargin: Layout.leftMargin
57+
Layout.bottomMargin: 20
58+
Layout.alignment: Qt.AlignCenter
59+
text: qsTr("Create wallet")
60+
}
61+
62+
ContinueButton {
63+
Layout.preferredWidth: Math.min(300, parent.width - 2 * Layout.leftMargin)
64+
Layout.leftMargin: 20
65+
Layout.rightMargin: Layout.leftMargin
66+
Layout.alignment: Qt.AlignCenter
67+
text: qsTr("Import wallet")
68+
borderColor: Theme.color.neutral6
69+
borderHoverColor: Theme.color.orangeLight1
70+
borderPressedColor: Theme.color.orangeLight2
71+
textColor: Theme.color.orange
72+
backgroundColor: "transparent"
73+
backgroundHoverColor: "transparent"
74+
backgroundPressedColor: "transparent"
75+
}
76+
}
77+
}
78+
}
79+

src/qml/res/icons/add-wallet-dark.png

9.76 KB
Loading

src/qml/res/src/add-wallet-dark.svg

Lines changed: 19 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)