From 8f38e10d0a981209de708a67c81ef45aa1122152 Mon Sep 17 00:00:00 2001 From: Dario Gabriel Lipicar Date: Thu, 6 Feb 2025 10:34:23 -0300 Subject: [PATCH] fix: proper handling of test network icon --- .../tests/tst_NetworkSelectorView.qml | 2 +- .../Wallet/controls/NetworkFilter.qml | 6 ++--- .../Wallet/views/NetworkSelectorView.qml | 23 +------------------ 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/storybook/qmlTests/tests/tst_NetworkSelectorView.qml b/storybook/qmlTests/tests/tst_NetworkSelectorView.qml index eef5d89d6d..3595e282c0 100644 --- a/storybook/qmlTests/tests/tst_NetworkSelectorView.qml +++ b/storybook/qmlTests/tests/tst_NetworkSelectorView.qml @@ -83,7 +83,7 @@ Item { verify(!!delegate) compare(delegate.title, model.chainName) - compare(delegate.iconUrl, (model.isTest ? Theme.svg(model.iconUrl + "-test") : Theme.svg(model.iconUrl))) + compare(delegate.iconUrl, Theme.svg(model.iconUrl)) compare(delegate.showIndicator, controlUnderTest.showIndicator) compare(delegate.multiSelection, controlUnderTest.multiSelection) compare(delegate.checkState, controlUnderTest.selection.includes(model.chainId) ? Qt.Checked : Qt.Unchecked) diff --git a/ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml b/ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml index 7b5a2d49c3..013fe20d95 100644 --- a/ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml +++ b/ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml @@ -101,7 +101,7 @@ StatusComboBox { width: 24 height: 24 - image.source: model.isTest ? Theme.svg(model.iconUrl + "-test") : Theme.svg(model.iconUrl) + image.source: Theme.svg(model.iconUrl) z: index + 1 image.layer.enabled: index < chainRepeater.count - 1 && row.spacing < 0 @@ -186,9 +186,7 @@ StatusComboBox { value: root.selection[0] ?? -1 } - readonly property string singleSelectionIconUrl: singleSelectionItem.item.iconUrl ? (singleSelectionItem.item.isTest ? singleSelectionItem.item.iconUrl + "-test" - : singleSelectionItem.item.iconUrl) - : "" + readonly property string singleSelectionIconUrl: singleSelectionItem.item.iconUrl ?? "" readonly property string singleCelectionChainName: singleSelectionItem.item.chainName ?? "" readonly property string titleText: { diff --git a/ui/app/AppLayouts/Wallet/views/NetworkSelectorView.qml b/ui/app/AppLayouts/Wallet/views/NetworkSelectorView.qml index d3cf8326ec..cb5122f39c 100644 --- a/ui/app/AppLayouts/Wallet/views/NetworkSelectorView.qml +++ b/ui/app/AppLayouts/Wallet/views/NetworkSelectorView.qml @@ -74,7 +74,7 @@ StatusListView { height: 48 width: ListView.view.width title: model.chainName - iconUrl: model.isTest ? Theme.svg(model.iconUrl + "-test") : Theme.svg(model.iconUrl) + iconUrl: Theme.svg(model.iconUrl) showIndicator: root.showIndicator multiSelection: root.multiSelection interactive: root.interactive @@ -97,27 +97,6 @@ StatusListView { } } - section { - property: "layer" - delegate: Loader { - required property int section - width: parent.width - height: active ? 44 : 0 - active: section === 2 - sourceComponent: layer2text - - Component { - id: layer2text - StatusBaseText { - color: Theme.palette.baseColor1 - text: qsTr("Layer 2") - leftPadding: 16 - topPadding: 14 - } - } - } - } - QtObject { id: d readonly property bool allSelected: root.selection.length === root.count