From 0e29dd413a3bb1bde74bb74236222f2142ecd833 Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Thu, 19 Feb 2026 13:31:33 +0100 Subject: [PATCH] feat: update views path --- README.md | 4 +- app/main.cpp | 2 +- flake.lock | 13 +++---- metadata.json | 2 +- nix/app.nix | 4 +- src/BlockchainBackend.cpp | 2 +- src/qml/BlockchainView.qml | 2 +- src/qml/views/LogsView.qml | 2 +- src/qml/views/WalletView.qml | 74 ++++++++++++++++++++++++++++++++++-- 9 files changed, 86 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 14cc923..4f6f212 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ After building the app with `nix build '.#app'`, you can run it: ./result/bin/logos-blockchain-ui-app ``` -The app will automatically load the required modules (capability_module, liblogos-blockchain-module) and the blockchain_ui Qt plugin. All dependencies are bundled in the Nix store layout. +The app will automatically load the required modules (capability_module, liblogos_blockchain_module) and the blockchain_ui Qt plugin. All dependencies are bundled in the Nix store layout. #### Nix Organization @@ -95,7 +95,7 @@ result/ │ └── Logos/DesignSystem/ # QML design system ├── modules/ │ ├── capability_module_plugin.dylib -│ ├── liblogos-blockchain-module.dylib +│ ├── liblogos_blockchain_module.dylib │ └── liblogos_blockchain.dylib └── blockchain_ui.dylib # Qt plugin (loaded by app) ``` diff --git a/app/main.cpp b/app/main.cpp index 62a6e72..6c0ba25 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) qWarning() << "Failed to load capability_module plugin"; } - if (!logos_core_load_plugin("liblogos-blockchain-module")) { + if (!logos_core_load_plugin("liblogos_blockchain_module")) { qWarning() << "Failed to load blockchain module plugin"; } diff --git a/flake.lock b/flake.lock index c900bc7..0fd0aa4 100644 --- a/flake.lock +++ b/flake.lock @@ -23,11 +23,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1771418281, - "narHash": "sha256-9nATUijKs7OCEcepHKghuWdgHu+hq11JbJz2Lv4uyDU=", + "lastModified": 1771509425, + "narHash": "sha256-hTmDLC+RcfPyuEbE8xnhL4qAN4U5M2RojWk0YonsSFY=", "owner": "logos-blockchain", "repo": "logos-blockchain", - "rev": "b862e6f640a79097b8a42c072e1f78bc430fa222", + "rev": "9ae525d6d16c0431b61d4e4c44f29dd0397f4fd4", "type": "github" }, "original": { @@ -67,17 +67,16 @@ ] }, "locked": { - "lastModified": 1771423304, - "narHash": "sha256-ONurMDUbFhdNzdbQ5r1jPPzFm2bHJBRElwcRNPPFmpM=", + "lastModified": 1771511900, + "narHash": "sha256-/5YkCwwEmfDhF0rAmp1u813kzooH93X0uzAjizxVUPM=", "owner": "logos-blockchain", "repo": "logos-blockchain-module", - "rev": "214a87885115296bf4e56fd820f5fbfdf4ee4453", + "rev": "7522b80cf7f71df90220f52d8274ea72ec6ea8f0", "type": "github" }, "original": { "owner": "logos-blockchain", "repo": "logos-blockchain-module", - "rev": "214a87885115296bf4e56fd820f5fbfdf4ee4453", "type": "github" } }, diff --git a/metadata.json b/metadata.json index 48d23f0..90b7c65 100644 --- a/metadata.json +++ b/metadata.json @@ -6,7 +6,7 @@ "type": "ui", "main": "blockchain_ui", "icon": ":/icons/blockchain.png", - "dependencies": ["liblogos-blockchain-module"], + "dependencies": ["liblogos_blockchain_module"], "category": "blockchain", "build": { "type": "cmake", diff --git a/nix/app.nix b/nix/app.nix index a55d7e3..a4555a5 100644 --- a/nix/app.nix +++ b/nix/app.nix @@ -164,8 +164,8 @@ pkgs.stdenv.mkDerivation rec { if [ -f "${logosCapabilityModule}/lib/capability_module_plugin.$OS_EXT" ]; then cp -L "${logosCapabilityModule}/lib/capability_module_plugin.$OS_EXT" "$out/modules/" fi - if [ -f "${logosBlockchainModule}/lib/liblogos-blockchain-module.$OS_EXT" ]; then - cp -L "${logosBlockchainModule}/lib/liblogos-blockchain-module.$OS_EXT" "$out/modules/" + if [ -f "${logosBlockchainModule}/lib/liblogos_blockchain_module.$OS_EXT" ]; then + cp -L "${logosBlockchainModule}/lib/liblogos_blockchain_module.$OS_EXT" "$out/modules/" fi # Copy liblogos_blockchain library to modules directory (needed by blockchain module) diff --git a/src/BlockchainBackend.cpp b/src/BlockchainBackend.cpp index e6deffd..172f2e1 100644 --- a/src/BlockchainBackend.cpp +++ b/src/BlockchainBackend.cpp @@ -10,7 +10,7 @@ namespace { const char SETTINGS_ORG[] = "Logos"; const char SETTINGS_APP[] = "BlockchainUI"; const char CONFIG_PATH_KEY[] = "configPath"; - const QString BLOCKCHAIN_MODULE_NAME = QStringLiteral("liblogos-blockchain-module"); + const QString BLOCKCHAIN_MODULE_NAME = QStringLiteral("liblogos_blockchain_module"); } BlockchainBackend::BlockchainBackend(LogosAPI* logosAPI, QObject* parent) diff --git a/src/qml/BlockchainView.qml b/src/qml/BlockchainView.qml index 7d43b2c..5b2b8f7 100644 --- a/src/qml/BlockchainView.qml +++ b/src/qml/BlockchainView.qml @@ -7,7 +7,7 @@ import QtCore import BlockchainBackend import Logos.Theme -import views +import "views" Rectangle { id: root diff --git a/src/qml/views/LogsView.qml b/src/qml/views/LogsView.qml index 63ee0b7..cfbe351 100644 --- a/src/qml/views/LogsView.qml +++ b/src/qml/views/LogsView.qml @@ -61,7 +61,7 @@ Control { spacing: 2 delegate: LogosText { - width: logsListView.width + width: ListView.view.width text: model.text font.pixelSize: Theme.typography.secondaryText wrapMode: Text.Wrap diff --git a/src/qml/views/WalletView.qml b/src/qml/views/WalletView.qml index f6063cd..a0250d1 100644 --- a/src/qml/views/WalletView.qml +++ b/src/qml/views/WalletView.qml @@ -52,10 +52,78 @@ ColumnLayout { // Dropdown of known addresses, or type a custom address ComboBox { id: balanceAddressCombo + Layout.fillWidth: true + padding: Theme.spacing.large + editable: true model: knownAddresses font.pixelSize: Theme.typography.secondaryText + + background: Rectangle { + color: Theme.palette.backgroundTertiary + radius: Theme.spacing.radiusLarge + border.color: Theme.palette.border + border.width: 1 + } + indicator: LogosText { + id: indicatorText + text: "▼" + font.pixelSize: Theme.typography.secondaryText + color: Theme.palette.textSecondary + x: balanceAddressCombo.width - width - Theme.spacing.small + y: (balanceAddressCombo.height - height) / 2 + visible: balanceAddressCombo.count > 0 + } + contentItem: LogosText { + width: parent.width - indicatorText.width - Theme.spacing.large + font.pixelSize: Theme.typography.secondaryText + font.bold: true + text: balanceAddressCombo.displayText + elide: Text.ElideRight + } + delegate: ItemDelegate { + id: delegate + + width: balanceAddressCombo.width + contentItem: LogosText { + width: parent.width + height: contentHeight + Theme.spacing.large + font.pixelSize: Theme.typography.secondaryText + font.bold: true + text: modelData + elide: Text.ElideRight + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + background: Rectangle { + color: delegate.highlighted ? + Theme.palette.backgroundTertiary: + Theme.palette.backgroundSecondary + } + highlighted: balanceAddressCombo.highlightedIndex === index + } + popup: Popup { + y: balanceAddressCombo.height - 1 + width: balanceAddressCombo.width + height: contentItem.implicitHeight + 100 + padding: 1 + + contentItem: ListView { + clip: true + implicitHeight: contentHeight + model: balanceAddressCombo.popup.visible ? balanceAddressCombo.delegateModel : null + ScrollIndicator.vertical: ScrollIndicator { } + highlightFollowsCurrentItem: false + } + + background: Rectangle { + color: Theme.palette.backgroundSecondary + border.color: Theme.palette.border + border.width: 1 + radius: Theme.spacing.radiusLarge + } + } } RowLayout { @@ -71,8 +139,8 @@ ColumnLayout { LogosButton { Layout.fillWidth: true - enabled: false - padding: Theme.spacing.medium + enabled: false + padding: Theme.spacing.medium contentItem: Text { id: balanceResultText width: parent.width @@ -161,7 +229,7 @@ ColumnLayout { component CustomTextFeild: TextField { id: textField Layout.fillWidth: true - placeholderText: qsTr("From key (64 hex chars)") + placeholderTextColor: Theme.palette.textMuted font.pixelSize: Theme.typography.secondaryText background: Rectangle {