From c47a432bae70285b54c2c9c9750c925063918100 Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Tue, 18 Jul 2023 16:24:35 +0200 Subject: [PATCH] fix(@desktop/wallet): `Wallet -> Settings -> Account order` - watch-only accounts and keycard accounts should have appropriate icon Fixes: #11513 --- .../Components/StatusDraggableListItem.qml | 38 ++++++++++++++++--- .../Profile/views/wallet/AccountOrderView.qml | 2 + 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/ui/StatusQ/src/StatusQ/Components/StatusDraggableListItem.qml b/ui/StatusQ/src/StatusQ/Components/StatusDraggableListItem.qml index 381b52d1dc..f48d800b29 100644 --- a/ui/StatusQ/src/StatusQ/Components/StatusDraggableListItem.qml +++ b/ui/StatusQ/src/StatusQ/Components/StatusDraggableListItem.qml @@ -115,6 +115,11 @@ ItemDelegate { This property holds the secondary text (title), displayed below primary */ property string secondaryTitle + /*! + \qmlproperty string StatusDraggableListItem::secondaryTitleIcon + This property holds the secondary title icon, displayed on the right of the secondary title + */ + property string secondaryTitleIcon: "" /*! \qmlproperty list StatusDraggableListItem::actions @@ -291,13 +296,24 @@ ItemDelegate { font.weight: root.highlighted ? Font.Medium : Font.Normal } - StatusBaseText { + Row { Layout.fillWidth: true - text: root.secondaryTitle - visible: text - color: Theme.palette.baseColor1 - elide: Text.ElideRight - maximumLineCount: 1 + visible: !!root.secondaryTitle + spacing: 8 + + StatusBaseText { + text: root.secondaryTitle + color: Theme.palette.baseColor1 + elide: Text.ElideRight + maximumLineCount: 1 + } + + Loader { + asynchronous: true + active: !!root.secondaryTitleIcon + visible: active + sourceComponent: secondaryTitleIconComponent + } } } @@ -319,6 +335,16 @@ ItemDelegate { } } + Component { + id: secondaryTitleIconComponent + StatusIcon { + width: 16 + height: 16 + icon: root.secondaryTitleIcon + color: Theme.palette.baseColor1 + } + } + Component { id: imageComponent StatusRoundedImage { diff --git a/ui/app/AppLayouts/Profile/views/wallet/AccountOrderView.qml b/ui/app/AppLayouts/Profile/views/wallet/AccountOrderView.qml index b8ca5fe891..aeface013a 100644 --- a/ui/app/AppLayouts/Profile/views/wallet/AccountOrderView.qml +++ b/ui/app/AppLayouts/Profile/views/wallet/AccountOrderView.qml @@ -86,6 +86,8 @@ StatusListView { return model.name } secondaryTitle: model.address + secondaryTitleIcon: model.walletType === Constants.watchWalletType? "show" : + model.keycardAccount ? "keycard" : "" hasEmoji: true icon.width: 40 icon.height: 40