From 89bd073eeddb69645ed35c4858685e5051924e8a Mon Sep 17 00:00:00 2001 From: MishkaRogachev Date: Mon, 5 Sep 2022 19:22:18 +0400 Subject: [PATCH] feat(CPP): Saved addresses section --- libs/Wallet/CMakeLists.txt | 3 +++ .../Status/Wallet/SavedAddressesController.h | 18 ++++++++++++++++++ .../qml/Status/Wallet/SavedAddressesView.qml | 11 +++++++++++ .../qml/Status/Wallet/WalletContentView.qml | 12 +++++++++++- libs/Wallet/src/SavedAddressesController.cpp | 9 +++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 libs/Wallet/include/Status/Wallet/SavedAddressesController.h create mode 100644 libs/Wallet/qml/Status/Wallet/SavedAddressesView.qml create mode 100644 libs/Wallet/src/SavedAddressesController.cpp diff --git a/libs/Wallet/CMakeLists.txt b/libs/Wallet/CMakeLists.txt index b7bb68cd53..5c1bfae536 100644 --- a/libs/Wallet/CMakeLists.txt +++ b/libs/Wallet/CMakeLists.txt @@ -23,6 +23,7 @@ qt6_add_qml_module(Wallet qml/Status/Wallet/AssetView.qml qml/Status/Wallet/WalletContentView.qml qml/Status/Wallet/WalletView.qml + qml/Status/Wallet/SavedAddressesView.qml # Required to suppress "qmllint may not work" warning OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Status/Wallet/ @@ -79,4 +80,6 @@ target_sources(Wallet src/WalletAsset.cpp include/Status/Wallet/WalletController.h src/WalletController.cpp + include/Status/Wallet/SavedAddressesController.h + src/SavedAddressesController.cpp ) diff --git a/libs/Wallet/include/Status/Wallet/SavedAddressesController.h b/libs/Wallet/include/Status/Wallet/SavedAddressesController.h new file mode 100644 index 0000000000..6de1629453 --- /dev/null +++ b/libs/Wallet/include/Status/Wallet/SavedAddressesController.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +namespace Status::Wallet +{ + +class SavedAddressesController : public QObject +{ + Q_OBJECT + QML_ELEMENT + QML_UNCREATABLE("C++ only") + +public: + SavedAddressesController(QObject* parent = nullptr); +}; + +} // namespace Status::Wallet diff --git a/libs/Wallet/qml/Status/Wallet/SavedAddressesView.qml b/libs/Wallet/qml/Status/Wallet/SavedAddressesView.qml new file mode 100644 index 0000000000..39143cdf49 --- /dev/null +++ b/libs/Wallet/qml/Status/Wallet/SavedAddressesView.qml @@ -0,0 +1,11 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import Status.Wallet +import Status.Containers + +Item { + id: root + +} diff --git a/libs/Wallet/qml/Status/Wallet/WalletContentView.qml b/libs/Wallet/qml/Status/Wallet/WalletContentView.qml index c1abf23a09..4ec89a8e0a 100644 --- a/libs/Wallet/qml/Status/Wallet/WalletContentView.qml +++ b/libs/Wallet/qml/Status/Wallet/WalletContentView.qml @@ -22,7 +22,7 @@ Item { } TabBar { id: tabBar - width: parent.width + Layout.fillWidth: true TabButton { text: qsTr("Assets") @@ -30,6 +30,9 @@ Item { TabButton { text: qsTr("Positions") } + TabButton { + text: qsTr("Saved Addresses") + } } SwipeView { @@ -69,6 +72,13 @@ Item { } } } + + Loader { + active: SwipeView.isCurrentItem + sourceComponent: SavedAddressesView { + + } + } } } } diff --git a/libs/Wallet/src/SavedAddressesController.cpp b/libs/Wallet/src/SavedAddressesController.cpp new file mode 100644 index 0000000000..4bbafc96d3 --- /dev/null +++ b/libs/Wallet/src/SavedAddressesController.cpp @@ -0,0 +1,9 @@ +#include "Status/Wallet/SavedAddressesController.h" + +namespace Status::Wallet +{ + +SavedAddressesController::SavedAddressesController(QObject* parent) + : QObject(parent) +{ } +} // namespace Status::Wallet