2023-06-22 12:32:43 +02:00
|
|
|
import QtQuick 2.14
|
|
|
|
|
2022-03-01 15:40:53 +01:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Core 0.1
|
2023-06-22 12:32:43 +02:00
|
|
|
|
|
|
|
import AppLayouts.Wallet 1.0
|
2022-03-01 15:40:53 +01:00
|
|
|
|
2023-05-22 17:55:47 +02:00
|
|
|
import utils 1.0
|
2022-03-01 15:40:53 +01:00
|
|
|
|
|
|
|
StatusListItem {
|
2022-06-22 15:16:21 +03:00
|
|
|
id: root
|
|
|
|
|
2022-03-01 15:40:53 +01:00
|
|
|
property var account
|
2023-07-21 10:41:24 +02:00
|
|
|
property var getNetworkShortNames: function(chainIds){}
|
2023-06-22 12:32:43 +02:00
|
|
|
property int totalCount: 0
|
2023-08-08 21:01:19 +02:00
|
|
|
property bool nextIconVisible: true
|
2022-06-22 15:16:21 +03:00
|
|
|
|
|
|
|
signal goToAccountView()
|
2023-06-22 12:32:43 +02:00
|
|
|
|
2022-07-20 10:18:27 +02:00
|
|
|
objectName: account.name
|
2023-06-22 12:32:43 +02:00
|
|
|
title: account.name
|
2023-12-20 15:10:50 +01:00
|
|
|
subTitle: WalletUtils.addressToDisplay(account.address, root.getNetworkShortNames(account.preferredSharingChainIds), true, sensor.containsMouse)
|
2023-06-22 12:32:43 +02:00
|
|
|
asset.color: !!account.colorId ? Utils.getColorForId(account.colorId): ""
|
2022-08-11 14:55:08 +03:00
|
|
|
asset.emoji: account.emoji
|
|
|
|
asset.name: !account.emoji ? "filled-account": ""
|
|
|
|
asset.letterSize: 14
|
|
|
|
asset.isLetterIdenticon: !!account.emoji
|
|
|
|
asset.bgColor: Theme.palette.primaryColor3
|
2022-09-27 23:26:26 +02:00
|
|
|
asset.width: 40
|
|
|
|
asset.height: 40
|
2022-06-22 15:16:21 +03:00
|
|
|
|
2023-06-22 12:32:43 +02:00
|
|
|
components: StatusIcon {
|
2023-02-28 15:54:10 +01:00
|
|
|
icon: "next"
|
2022-06-22 15:16:21 +03:00
|
|
|
color: Theme.palette.baseColor1
|
2023-08-08 21:01:19 +02:00
|
|
|
visible: root.nextIconVisible
|
2022-06-22 15:16:21 +03:00
|
|
|
}
|
2023-06-22 12:32:43 +02:00
|
|
|
|
|
|
|
onClicked: goToAccountView()
|
|
|
|
|
|
|
|
// This is used to give the first and last delgate rounded corners
|
|
|
|
Rectangle {
|
|
|
|
visible: totalCount > 1
|
|
|
|
readonly property bool isLastOrFirstItem: index === 0 || index === (totalCount-1)
|
|
|
|
width: parent.width
|
|
|
|
height: isLastOrFirstItem? parent.height/2 : parent.height
|
|
|
|
anchors.top: !isLastOrFirstItem || index === (totalCount-1) ? parent.top: undefined
|
|
|
|
anchors.bottom: index === 0 ? parent.bottom: undefined
|
|
|
|
color: parent.color
|
|
|
|
z: parent.z - 10
|
|
|
|
}
|
2022-03-10 18:01:17 +01:00
|
|
|
}
|