diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index c9bdb051e8..86635acafb 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -319,6 +319,7 @@ QML_RES_ICONS = \ qml/res/icons/arrow-down.png \ qml/res/icons/arrow-up.png \ qml/res/icons/bitcoin-circle.png \ + qml/res/icons/blockclock-icon.png \ qml/res/icons/blockclock-size-compact.png \ qml/res/icons/blockclock-size-showcase.png \ qml/res/icons/blocktime-dark.png \ @@ -329,12 +330,17 @@ QML_RES_ICONS = \ qml/res/icons/cross.png \ qml/res/icons/export.png \ qml/res/icons/gear.png \ + qml/res/icons/gear-outline.png \ qml/res/icons/info.png \ qml/res/icons/network-dark.png \ qml/res/icons/network-light.png \ qml/res/icons/shutdown.png \ + qml/res/icons/singlesig-wallet.png \ qml/res/icons/storage-dark.png \ - qml/res/icons/storage-light.png + qml/res/icons/storage-light.png \ + qml/res/icons/triangle-down.png \ + qml/res/icons/triangle-up.png + QML_QRC_CPP = qml/qrc_bitcoin.cpp QML_QRC = qml/bitcoin_qml.qrc @@ -360,6 +366,7 @@ QML_RES_QML = \ qml/components/TotalBytesIndicator.qml \ qml/controls/ContinueButton.qml \ qml/controls/CoreText.qml \ + qml/controls/DirectionalStackView.qml \ qml/controls/ExternalLink.qml \ qml/controls/FocusBorder.qml \ qml/controls/Header.qml \ @@ -369,6 +376,8 @@ QML_RES_QML = \ qml/controls/PageIndicator.qml \ qml/controls/NavigationBar.qml \ qml/controls/NavigationBar2.qml \ + qml/controls/NavigationBlockClockTab.qml \ + qml/controls/NavigationTab.qml \ qml/controls/OptionButton.qml \ qml/controls/OptionSwitch.qml \ qml/controls/OutlineButton.qml \ @@ -399,7 +408,10 @@ QML_RES_QML = \ qml/pages/settings/SettingsDisplay.qml \ qml/pages/settings/SettingsProxy.qml \ qml/pages/settings/SettingsStorage.qml \ - qml/pages/settings/SettingsTheme.qml + qml/pages/settings/SettingsTheme.qml \ + qml/pages/wallet/DesktopWallets.qml \ + qml/pages/wallet/MobileWallets.qml \ + qml/pages/wallet/mobile/Activity.qml if TARGET_ANDROID BITCOIN_QT_H += qml/androidnotifier.h diff --git a/src/qml/appmode.h b/src/qml/appmode.h index 8265984103..ba15865eda 100644 --- a/src/qml/appmode.h +++ b/src/qml/appmode.h @@ -12,6 +12,7 @@ class AppMode : public QObject Q_OBJECT Q_PROPERTY(bool isDesktop READ isDesktop NOTIFY modeChanged) Q_PROPERTY(bool isMobile READ isMobile NOTIFY modeChanged) + Q_PROPERTY(bool walletEnabled READ walletEnabled NOTIFY walletEnabledChanged) Q_PROPERTY(QString state READ state NOTIFY modeChanged) public: @@ -20,12 +21,15 @@ class AppMode : public QObject MOBILE }; - explicit AppMode(Mode mode) : m_mode(mode) + explicit AppMode(Mode mode, bool wallet_enabled) + : m_mode(mode) + , m_wallet_enabled(wallet_enabled) { } bool isMobile() { return m_mode == MOBILE; } bool isDesktop() { return m_mode == DESKTOP; } + bool walletEnabled() { return m_wallet_enabled; } QString state() { switch (m_mode) { @@ -41,9 +45,11 @@ class AppMode : public QObject Q_SIGNALS: void modeChanged(); + void walletEnabledChanged(); private: const Mode m_mode; + const bool m_wallet_enabled; }; #endif // BITCOIN_QML_APPMODE_H diff --git a/src/qml/bitcoin.cpp b/src/qml/bitcoin.cpp index d87386cbd5..90e713bfd7 100644 --- a/src/qml/bitcoin.cpp +++ b/src/qml/bitcoin.cpp @@ -75,17 +75,33 @@ void SetupUIArgs(ArgsManager& argsman) argsman.AddArg("-splash", strprintf("Show splash screen on startup (default: %u)", DEFAULT_SPLASHSCREEN), ArgsManager::ALLOW_ANY, OptionsCategory::GUI); } +AppMode SetupAppMode() +{ + bool wallet_enabled; + AppMode::Mode mode; + #ifdef __ANDROID__ + mode = AppMode::MOBILE; + #else + mode = AppMode::DESKTOP; + #endif // __ANDROID__ + + #ifdef ENABLE_WALLET + wallet_enabled = true; + #else + wallet_enabled = false; + #endif // ENABLE_WALLET + + return AppMode(mode, wallet_enabled); +} + bool InitErrorMessageBox( const bilingual_str& message, [[maybe_unused]] const std::string& caption, [[maybe_unused]] unsigned int style) { QQmlApplicationEngine engine; -#ifdef __ANDROID__ - AppMode app_mode(AppMode::MOBILE); -#else - AppMode app_mode(AppMode::DESKTOP); -#endif // __ANDROID__ + + AppMode app_mode = SetupAppMode(); qmlRegisterSingletonInstance("org.bitcoincore.qt", 1, 0, "AppMode", &app_mode); engine.rootContext()->setContextProperty("message", QString::fromStdString(message.translated)); @@ -284,11 +300,8 @@ int QmlGuiMain(int argc, char* argv[]) engine.rootContext()->setContextProperty("optionsModel", &options_model); engine.rootContext()->setContextProperty("needOnboarding", need_onboarding); -#ifdef __ANDROID__ - AppMode app_mode(AppMode::MOBILE); -#else - AppMode app_mode(AppMode::DESKTOP); -#endif // __ANDROID__ + + AppMode app_mode = SetupAppMode(); qmlRegisterSingletonInstance("org.bitcoincore.qt", 1, 0, "AppMode", &app_mode); qmlRegisterType("org.bitcoincore.qt", 1, 0, "BlockClockDial"); diff --git a/src/qml/bitcoin_qml.qrc b/src/qml/bitcoin_qml.qrc index ae36776d5a..7280ae23b9 100644 --- a/src/qml/bitcoin_qml.qrc +++ b/src/qml/bitcoin_qml.qrc @@ -21,6 +21,7 @@ components/TotalBytesIndicator.qml controls/ContinueButton.qml controls/CoreText.qml + controls/DirectionalStackView.qml controls/ExternalLink.qml controls/FocusBorder.qml controls/Header.qml @@ -30,6 +31,8 @@ controls/PageIndicator.qml controls/NavigationBar.qml controls/NavigationBar2.qml + controls/NavigationBlockClockTab.qml + controls/NavigationTab.qml controls/OptionButton.qml controls/OptionSwitch.qml controls/OutlineButton.qml @@ -61,11 +64,15 @@ pages/settings/SettingsProxy.qml pages/settings/SettingsStorage.qml pages/settings/SettingsTheme.qml + pages/wallet/DesktopWallets.qml + pages/wallet/MobileWallets.qml + pages/wallet/mobile/Activity.qml res/icons/arrow-down.png res/icons/arrow-up.png res/icons/bitcoin-circle.png + res/icons/blockclock-icon.png res/icons/blockclock-size-compact.png res/icons/blockclock-size-showcase.png res/icons/blocktime-dark.png @@ -77,12 +84,17 @@ res/icons/cross.png res/icons/export.png res/icons/gear.png + res/icons/gear-outline.png res/icons/info.png res/icons/network-dark.png res/icons/network-light.png res/icons/shutdown.png + res/icons/singlesig-wallet.png res/icons/storage-dark.png res/icons/storage-light.png + res/icons/storage-light.png + res/icons/triangle-down.png + res/icons/triangle-up.png res/fonts/Inter-Regular.otf diff --git a/src/qml/components/BlockClock.qml b/src/qml/components/BlockClock.qml index a02abae6a4..6e1c28f0a7 100644 --- a/src/qml/components/BlockClock.qml +++ b/src/qml/components/BlockClock.qml @@ -15,6 +15,7 @@ Item { id: root property real parentWidth: 600 property real parentHeight: 600 + property bool showNetworkIndicator: true width: dial.width height: dial.height + networkIndicator.height + networkIndicator.anchors.topMargin @@ -146,6 +147,7 @@ Item { NetworkIndicator { id: networkIndicator + show: root.showNetworkIndicator anchors.top: dial.bottom anchors.topMargin: networkIndicator.visible ? 30 : 0 anchors.horizontalCenter: root.horizontalCenter diff --git a/src/qml/components/NetworkIndicator.qml b/src/qml/components/NetworkIndicator.qml index 471ccfbbcd..9f3ee8751a 100644 --- a/src/qml/components/NetworkIndicator.qml +++ b/src/qml/components/NetworkIndicator.qml @@ -12,12 +12,14 @@ import org.bitcoincore.qt 1.0 Button { id: root property color bgColor + property bool shorten: false + property bool show: true property int textSize: 15 topPadding: 2 bottomPadding: 2 leftPadding: 7 rightPadding: 7 - state: chainModel.currentNetworkName + state: show ? chainModel.currentNetworkName : "MAIN" contentItem: CoreText { text: root.text font.pixelSize: root.textSize @@ -47,7 +49,7 @@ Button { PropertyChanges { target: root visible: true - text: qsTr("Test Network") + text: shorten ? qsTr("Test Network") : qsTr("Testnet") bgColor: Theme.color.green } }, @@ -56,7 +58,7 @@ Button { PropertyChanges { target: root visible: true - text: qsTr("Signet Network") + text: shorten ? qsTr("Signet Network") : qsTr("Signet") bgColor: Theme.color.amber } }, @@ -65,7 +67,7 @@ Button { PropertyChanges { target: root visible: true - text: qsTr("Regtest Mode") + text: shorten ? qsTr("Regtest Mode") : qsTr("Regtest") bgColor: Theme.color.blue } } diff --git a/src/qml/components/WalletBadge.qml b/src/qml/components/WalletBadge.qml new file mode 100644 index 0000000000..21f4a8c86b --- /dev/null +++ b/src/qml/components/WalletBadge.qml @@ -0,0 +1,16 @@ +// Copyright (c) 2024 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 org.bitcoincore.qt 1.0 + +Row { + Column { + + } + Column { + + } +} \ No newline at end of file diff --git a/src/qml/components/blockclockdial.cpp b/src/qml/components/blockclockdial.cpp index a6842702ea..f2a986d4be 100644 --- a/src/qml/components/blockclockdial.cpp +++ b/src/qml/components/blockclockdial.cpp @@ -317,12 +317,18 @@ void BlockClockDial::paint(QPainter * painter) painter->setRenderHint(QPainter::Antialiasing); paintBackground(painter); - paintTimeTicks(painter); + if (!m_is_mini) { + paintTimeTicks(painter); + } if (paused()) return; if (connected() && synced()) { - paintBlocks(painter); + if (m_is_mini) { + paintProgress(painter); + } else { + paintBlocks(painter); + } } else if (connected()) { paintProgress(painter); } else if (m_animation_timer.isActive()) { @@ -330,3 +336,9 @@ void BlockClockDial::paint(QPainter * painter) } m_animating_max_angle = incrementAnimatingMaxAngle(m_animating_max_angle); } + +void BlockClockDial::setMini(bool is_mini) +{ + m_is_mini = is_mini; + update(); +} diff --git a/src/qml/components/blockclockdial.h b/src/qml/components/blockclockdial.h index e7a103f0c0..361b42c7ef 100644 --- a/src/qml/components/blockclockdial.h +++ b/src/qml/components/blockclockdial.h @@ -22,8 +22,9 @@ class BlockClockDial : public QQuickPaintedItem Q_PROPERTY(qreal penWidth READ penWidth WRITE setPenWidth) Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged) Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) - Q_PROPERTY(QList confirmationColors READ confirmationColors WRITE setConfirmationColors ) + Q_PROPERTY(QList confirmationColors READ confirmationColors WRITE setConfirmationColors) Q_PROPERTY(QColor timeTickColor READ timeTickColor WRITE setTimeTickColor) + Q_PROPERTY(bool isMini READ isMini WRITE setMini) public: explicit BlockClockDial(QQuickItem * parent = nullptr); @@ -39,6 +40,7 @@ class BlockClockDial : public QQuickPaintedItem QColor backgroundColor() const { return m_background_color; }; QList confirmationColors() const { return m_confirmation_colors; }; QColor timeTickColor() const { return m_time_tick_color; }; + bool isMini() const { return m_is_mini; }; public Q_SLOTS: void setTimeRatioList(QVariantList new_time); @@ -51,6 +53,7 @@ public Q_SLOTS: void setBackgroundColor(QColor color); void setConfirmationColors(QList colorList); void setTimeTickColor(QColor color); + void setMini(bool is_mini); Q_SIGNALS: void scaleChanged(); @@ -84,6 +87,7 @@ public Q_SLOTS: QTimer m_animation_timer{this}; QTimer m_delay_timer; qreal m_animating_max_angle = 0; + bool m_is_mini = false; }; #endif // BITCOIN_QML_COMPONENTS_BLOCKCLOCKDIAL_H diff --git a/src/qml/controls/DirectionalStackView.qml b/src/qml/controls/DirectionalStackView.qml new file mode 100644 index 0000000000..5b76e07526 --- /dev/null +++ b/src/qml/controls/DirectionalStackView.qml @@ -0,0 +1,114 @@ +// Copyright (c) 2024 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 + +StackView { + id: root + + function pushLeft(item) { + root.pushEnter = pushEnterLeft; + root.pushExit = pushExitLeft; + root.push(item); + } + + function pushRight(item) { + root.pushEnter = pushEnterRight; + root.pushExit = pushExitRight; + root.push(item); + } + + function popLeft() { + root.popEnter = popEnterLeft; + root.popExit = pushExitLeft; + root.pop(); + } + + function popRight() { + root.popEnter = popEnterRight; + root.popExit = pushExitRight; + root.pop(); + } + + Transition { + id: popEnterLeft + XAnimator { + from: -1 * root.width + to: 0 + duration: 400 + easing.type: Easing.OutCubic + } + } + + Transition { + id: popExitLeft + XAnimator { + from: 0 + to: root.width + duration: 400 + easing.type: Easing.OutCubic + } + } + + Transition { + id: popEnterRight + XAnimator { + from: root.width + to: 0 + duration: 400 + easing.type: Easing.OutCubic + } + } + + Transition { + id: popExitRight + XAnimator { + from: 0 + to: -1 * root.width + duration: 400 + easing.type: Easing.OutCubic + } + } + + Transition { + id: pushEnterLeft + XAnimator { + from: -1 * root.width + to: 0 + duration: 400 + easing.type: Easing.OutCubic + } + } + + Transition { + id: pushExitLeft + XAnimator { + from: 0 + to: root.width + duration: 400 + easing.type: Easing.OutCubic + } + } + + Transition { + id: pushEnterRight + XAnimator { + from: root.width + to: 0 + duration: 400 + easing.type: Easing.OutCubic + } + } + + Transition { + id: pushExitRight + XAnimator { + from: 0 + to: -1 * root.width + duration: 400 + easing.type: Easing.OutCubic + } + } +} diff --git a/src/qml/controls/NavigationBlockClockTab.qml b/src/qml/controls/NavigationBlockClockTab.qml new file mode 100644 index 0000000000..56620235d3 --- /dev/null +++ b/src/qml/controls/NavigationBlockClockTab.qml @@ -0,0 +1,67 @@ +// Copyright (c) 2024 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 org.bitcoincore.qt 1.0 + +Button { + property color bgActiveColor: Theme.color.orange + property color textColor: Theme.color.neutral7 + property color textHoverColor: Theme.color.neutral9 + property color textActiveColor: Theme.color.orange + property color iconColor: "transparent" + property string iconSource: "" + property bool connected: nodeModel.numOutboundPeers > 0 + property bool synced: nodeModel.verificationProgress > 0.999 + property bool paused: false + + id: root + checkable: true + hoverEnabled: AppMode.isDesktop + implicitHeight: 60 + implicitWidth: 80 + bottomPadding: 0 + topPadding: 0 + + contentItem: BlockClockDial { + anchors.fill: parent + isMini: true + penWidth: 1 + timeRatioList: chainModel.timeRatioList + verificationProgress: nodeModel.verificationProgress + paused: root.paused + connected: root.connected + synced: nodeModel.verificationProgress > 0.999 + backgroundColor: Theme.color.neutral2 + timeTickColor: Theme.color.neutral5 + confirmationColors: Theme.color.confirmationColors + } + + background: Item { + Rectangle { + id: bg + height: parent.height - 5 + width: parent.width + radius: 5 + color: Theme.color.neutral3 + visible: root.hovered + + FocusBorder { + visible: root.visualFocus + } + + Behavior on color { + ColorAnimation { duration: 150 } + } + } + Rectangle { + anchors.bottom: parent.bottom + width: parent.width + height: 3 + visible: root.checked + color: root.bgActiveColor + } + } +} diff --git a/src/qml/controls/NavigationTab.qml b/src/qml/controls/NavigationTab.qml new file mode 100644 index 0000000000..219c90a135 --- /dev/null +++ b/src/qml/controls/NavigationTab.qml @@ -0,0 +1,84 @@ +// Copyright (c) 2024 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 org.bitcoincore.qt 1.0 + +Button { + property color bgActiveColor: Theme.color.orange + property color textColor: Theme.color.neutral7 + property color textHoverColor: Theme.color.neutral9 + property color textActiveColor: Theme.color.orange + property color iconColor: "transparent" + property string iconSource: "" + + id: root + checkable: true + hoverEnabled: AppMode.isDesktop + implicitHeight: 60 + implicitWidth: 80 + bottomPadding: 0 + topPadding: 0 + + contentItem: Item { + width: parent.width + height: parent.height + CoreText { + id: buttonText + font.pixelSize: 15 + text: root.text + color: root.textColor + bold: true + visible: root.text !== "" + anchors.centerIn: parent + } + Icon { + id: icon + source: root.iconSource + color: iconColor + visible: root.iconSource !== "" + anchors.centerIn: parent + } + } + + background: Item { + Rectangle { + id: bg + height: parent.height - 5 + width: parent.width + radius: 5 + color: Theme.color.neutral3 + visible: root.hovered + + FocusBorder { + visible: root.visualFocus + } + + Behavior on color { + ColorAnimation { duration: 150 } + } + } + Rectangle { + anchors.bottom: parent.bottom + width: parent.width + height: 3 + visible: root.checked + color: root.bgActiveColor + } + } + + states: [ + State { + name: "CHECKED"; when: root.checked + PropertyChanges { target: buttonText; color: root.textActiveColor } + PropertyChanges { target: icon; color: root.textActiveColor } + }, + State { + name: "HOVER"; when: root.hovered + PropertyChanges { target: buttonText; color: root.textHoverColor } + PropertyChanges { target: icon; color: root.textHoverColor } + } + ] +} diff --git a/src/qml/imageprovider.cpp b/src/qml/imageprovider.cpp index 26ffc102ea..4a8837f085 100644 --- a/src/qml/imageprovider.cpp +++ b/src/qml/imageprovider.cpp @@ -37,6 +37,11 @@ QPixmap ImageProvider::requestPixmap(const QString& id, QSize* size, const QSize return QIcon(":/icons/bitcoin-circle").pixmap(requested_size); } + if (id == "blockclock-icon") { + *size = requested_size; + return QIcon(":/icons/blockclock-icon").pixmap(requested_size); + } + if (id == "blockclock-size-compact") { *size = requested_size; return QIcon(":/icons/blockclock-size-compact").pixmap(requested_size); @@ -92,6 +97,11 @@ QPixmap ImageProvider::requestPixmap(const QString& id, QSize* size, const QSize return QIcon(":/icons/gear").pixmap(requested_size); } + if (id == "gear-outline") { + *size = requested_size; + return QIcon(":/icons/gear-outline").pixmap(requested_size); + } + if (id == "info") { *size = requested_size; return QIcon(":/icons/info").pixmap(requested_size); @@ -112,6 +122,11 @@ QPixmap ImageProvider::requestPixmap(const QString& id, QSize* size, const QSize return QIcon(":/icons/shutdown").pixmap(requested_size); } + if (id == "singlesig-wallet") { + *size = requested_size; + return QIcon(":/icons/singlesig-wallet").pixmap(requested_size); + } + if (id == "storage-dark") { *size = requested_size; return QIcon(":/icons/storage-dark").pixmap(requested_size); @@ -122,5 +137,15 @@ QPixmap ImageProvider::requestPixmap(const QString& id, QSize* size, const QSize return QIcon(":/icons/storage-light").pixmap(requested_size); } + if (id == "triangle-down") { + *size = requested_size; + return QIcon(":/icons/triangle-down").pixmap(requested_size); + } + + if (id == "triangle-up") { + *size = requested_size; + return QIcon(":/icons/triangle-up").pixmap(requested_size); + } + return {}; } diff --git a/src/qml/pages/main.qml b/src/qml/pages/main.qml index 581e9b42b4..8aad5c0c49 100644 --- a/src/qml/pages/main.qml +++ b/src/qml/pages/main.qml @@ -11,6 +11,7 @@ import "../components" import "../controls" import "./onboarding" import "./node" +import "./wallet" ApplicationWindow { id: appWindow @@ -31,9 +32,23 @@ ApplicationWindow { ColorAnimation { duration: 150 } } - StackView { + DirectionalStackView { id: main - initialItem: needOnboarding ? onboardingWizard : node + initialItem: { + if (needOnboarding) { + onboardingWizard + } else { + if (AppMode.walletEnabled) { + if (AppMode.isDesktop) { + desktopWallets + } else { + mobileWallets + } + } else { + node + } + } + } anchors.fill: parent focus: true Keys.onReleased: { @@ -66,10 +81,30 @@ ApplicationWindow { OnboardingStorageAmount {} OnboardingConnection {} - onFinishedChanged: main.push(node) + onFinishedChanged: { + if (AppMode.walletEnabled) { + if (AppMode.isDesktop) { + main.push(desktopWallets) + } else { + main.push(mobileWallets) + } + } else { + main.push(node) + } + } } } + Component { + id: desktopWallets + DesktopWallets {} + } + + Component { + id: mobileWallets + MobileWallets {} + } + Component { id: shutdown Shutdown {} diff --git a/src/qml/pages/node/NodeSettings.qml b/src/qml/pages/node/NodeSettings.qml index 87a5f5de4b..a2ca4c667b 100644 --- a/src/qml/pages/node/NodeSettings.qml +++ b/src/qml/pages/node/NodeSettings.qml @@ -12,6 +12,8 @@ import "../settings" Item { signal doneClicked + property alias showDoneButton: doneButton.visible + id: root StackView { @@ -33,6 +35,7 @@ Item { header: "Settings" } rightItem: NavButton { + id: doneButton text: qsTr("Done") onClicked: root.doneClicked() } diff --git a/src/qml/pages/wallet/DesktopWallets.qml b/src/qml/pages/wallet/DesktopWallets.qml new file mode 100644 index 0000000000..80aab1cfe4 --- /dev/null +++ b/src/qml/pages/wallet/DesktopWallets.qml @@ -0,0 +1,122 @@ +// Copyright (c) 2024 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 QtQuick.Layouts 1.15 +import org.bitcoincore.qt 1.0 +import "../../controls" +import "../../components" +import "../node" + +Page { + id: root + background: null + + ButtonGroup { id: navigationTabs } + + header: NavigationBar2 { + id: navBar + leftItem: RowLayout { + spacing: 5 + Icon { + source: "image://images/singlesig-wallet" + color: Theme.color.neutral8 + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 + Layout.leftMargin: 10 + } + Column { + spacing: 2 + CoreText { + text: "Singlesig Wallet" + color: Theme.color.neutral7 + bold: true + } + CoreText { + text: " 0.00 167 599" + color: Theme.color.neutral7 + } + } + } + centerItem: RowLayout { + NavigationTab { + id: activityTabButton + checked: true + text: qsTr("Activity") + property int index: 0 + ButtonGroup.group: navigationTabs + } + NavigationTab { + text: qsTr("Send") + property int index: 1 + ButtonGroup.group: navigationTabs + } + NavigationTab { + text: qsTr("Receive") + property int index: 2 + ButtonGroup.group: navigationTabs + } + } + rightItem: RowLayout { + spacing: 5 + NetworkIndicator { + textSize: 11 + Layout.rightMargin: 5 + } + NavigationBlockClockTab { + Layout.preferredWidth: 30 + Layout.rightMargin: 10 + property int index: 3 + ButtonGroup.group: navigationTabs + } + NavigationTab { + iconSource: "image://images/gear-outline" + Layout.preferredWidth: 30 + property int index: 4 + ButtonGroup.group: navigationTabs + } + } + background: Rectangle { + color: Theme.color.neutral4 + anchors.bottom: navBar.bottom + anchors.bottomMargin: 4 + height: 1 + width: parent.width + } + } + + StackLayout { + width: parent.width + height: parent.height + currentIndex: navigationTabs.checkedButton.index + Item { + id: activityTab + CoreText { text: "Activity" } + } + Item { + id: sendTab + CoreText { text: "Send" } + } + Item { + id: receiveTab + CoreText { text: "Receive" } + } + Item { + id: blockClockTab + anchors.fill: parent + BlockClock { + parentWidth: parent.width - 40 + parentHeight: parent.height + anchors.fill: parent + showNetworkIndicator: false + } + } + NodeSettings { + showDoneButton: false + } + } + + Component.onCompleted: nodeModel.startNodeInitializionThread(); +} \ No newline at end of file diff --git a/src/qml/pages/wallet/MobileWallets.qml b/src/qml/pages/wallet/MobileWallets.qml new file mode 100644 index 0000000000..ba6746645e --- /dev/null +++ b/src/qml/pages/wallet/MobileWallets.qml @@ -0,0 +1,56 @@ +// Copyright (c) 2024 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 QtQuick.Layouts 1.15 +import org.bitcoincore.qt 1.0 +import "../../controls" +import "../../components" +import "../node" +import "./mobile" + +Item { + id: root + + Activity { + anchors.fill: parent + onBlockClockClicked: { + root.StackView.view.pushLeft(blockClock) + } + onSettingsClicked: { + root.StackView.view.pushRight(settings) + } + } + + Component { + id: blockClock + Page { + id: root + background: null + clip: true + header: NavigationBar2 { + rightItem: NavButton { + iconSource: "image://images/caret-right" + onClicked: root.StackView.view.popRight() + } + } + + BlockClock { + parentWidth: parent.width - 40 + parentHeight: parent.height + anchors.centerIn: parent + } + } + } + + Component { + id: settings + NodeSettings { + onDoneClicked: root.StackView.view.popLeft() + } + } + + Component.onCompleted: nodeModel.startNodeInitializionThread(); +} \ No newline at end of file diff --git a/src/qml/pages/wallet/mobile/Activity.qml b/src/qml/pages/wallet/mobile/Activity.qml new file mode 100644 index 0000000000..ccf6bde882 --- /dev/null +++ b/src/qml/pages/wallet/mobile/Activity.qml @@ -0,0 +1,135 @@ +// Copyright (c) 2024 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 QtQuick.Layouts 1.15 +import org.bitcoincore.qt 1.0 +import "../../../controls" +import "../../../components" +import "../../node" + +Page { + id: root + background: null + + signal blockClockClicked() + signal settingsClicked() + + header: Item { + height: 46 + width: parent.width + Button { + anchors.left: parent.left + anchors.leftMargin: 7.5 + icon.source: "image://images/blockclock-icon" + icon.color: "transparent" + icon.width: 30 + icon.height: 30 + background: null + + onClicked: { + blockClockClicked() + } + } + + Button { + anchors.right: parent.right + anchors.rightMargin: 7.5 + icon.source: "image://images/gear-outline" + icon.color: Theme.color.neutral8 + icon.width: 30 + icon.height: 30 + background: null + + onClicked: { + settingsClicked() + } + } + } + + ColumnLayout { + spacing: 17 + width: parent.width + RowLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 0 + Icon { + source: "image://images/singlesig-wallet" + color: Theme.color.neutral8 + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 + } + CoreText { + text: "Savings" + color: Theme.color.neutral7 + bold: true + font.pixelSize: 21 + } + } + CoreText { + Layout.alignment: Qt.AlignHCenter + text: " 0.00 167 930" + color: Theme.color.neutral7 + font.pixelSize: 27 + } + RowLayout { + Layout.alignment: Qt.AlignHCenter + Layout.topMargin: 30 + spacing: 40 + ColumnLayout { + spacing: 7 + Layout.alignment: Qt.AlignHCenter + Rectangle { + Layout.alignment: Qt.AlignHCenter + width: 50 + height: width + radius: 100 + color: "transparent" + border.color: Theme.color.neutral5 + border.width: 1 + Icon { + anchors.centerIn: parent + source: "image://images/triangle-up" + color: Theme.color.neutral8 + width: 30 + height: 30 + } + } + CoreText { + Layout.alignment: Qt.AlignHCenter + text: qsTr("Send") + color: Theme.color.neutral7 + font.pixelSize: 15 + } + } + ColumnLayout { + spacing: 7 + Layout.alignment: Qt.AlignHCenter + Rectangle { + Layout.alignment: Qt.AlignHCenter + width: 50 + height: width + radius: 100 + color: "transparent" + border.color: Theme.color.neutral5 + border.width: 1 + Icon { + anchors.centerIn: parent + source: "image://images/triangle-down" + color: Theme.color.neutral8 + width: 30 + height: 30 + } + } + CoreText { + Layout.alignment: Qt.AlignHCenter + text: qsTr("Receive") + color: Theme.color.neutral7 + font.pixelSize: 15 + } + } + } + } +} \ No newline at end of file diff --git a/src/qml/res/icons/blockclock-icon.png b/src/qml/res/icons/blockclock-icon.png new file mode 100644 index 0000000000..90d37f1ba6 Binary files /dev/null and b/src/qml/res/icons/blockclock-icon.png differ diff --git a/src/qml/res/icons/gear-outline.png b/src/qml/res/icons/gear-outline.png new file mode 100644 index 0000000000..2a868c7700 Binary files /dev/null and b/src/qml/res/icons/gear-outline.png differ diff --git a/src/qml/res/icons/singlesig-wallet.png b/src/qml/res/icons/singlesig-wallet.png new file mode 100644 index 0000000000..36a82fec8a Binary files /dev/null and b/src/qml/res/icons/singlesig-wallet.png differ diff --git a/src/qml/res/icons/triangle-down.png b/src/qml/res/icons/triangle-down.png new file mode 100644 index 0000000000..60a708fb25 Binary files /dev/null and b/src/qml/res/icons/triangle-down.png differ diff --git a/src/qml/res/icons/triangle-up.png b/src/qml/res/icons/triangle-up.png new file mode 100644 index 0000000000..9b3edc0255 Binary files /dev/null and b/src/qml/res/icons/triangle-up.png differ diff --git a/src/qml/res/src/blockclock-icon.svg b/src/qml/res/src/blockclock-icon.svg new file mode 100644 index 0000000000..ca3f943033 --- /dev/null +++ b/src/qml/res/src/blockclock-icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/qml/res/src/gear-outline.svg b/src/qml/res/src/gear-outline.svg new file mode 100644 index 0000000000..8c7e5dd018 --- /dev/null +++ b/src/qml/res/src/gear-outline.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/qml/res/src/singlesig-wallet.svg b/src/qml/res/src/singlesig-wallet.svg new file mode 100644 index 0000000000..76d1ca5019 --- /dev/null +++ b/src/qml/res/src/singlesig-wallet.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/qml/res/src/triangle-down.svg b/src/qml/res/src/triangle-down.svg new file mode 100644 index 0000000000..f4439a96f1 --- /dev/null +++ b/src/qml/res/src/triangle-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/qml/res/src/triangle-up.svg b/src/qml/res/src/triangle-up.svg new file mode 100644 index 0000000000..2f0cabcecf --- /dev/null +++ b/src/qml/res/src/triangle-up.svg @@ -0,0 +1,3 @@ + + +