status-desktop/ui/app/AppLayouts/Profile/controls/WalletAccountDelegate.qml

53 lines
1.6 KiB
QML
Raw Normal View History

import QtQuick 2.14
2022-03-01 14:40:53 +00:00
import StatusQ.Components 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Core 0.1
import AppLayouts.Wallet 1.0
2022-03-01 14:40:53 +00:00
import utils 1.0
2022-03-01 14:40:53 +00:00
StatusListItem {
2022-06-22 12:16:21 +00:00
id: root
2022-03-01 14:40:53 +00:00
property var account
property var getNetworkShortNames: function(chainIds){}
property int totalCount: 0
property bool nextIconVisible: true
2022-06-22 12:16:21 +00:00
signal goToAccountView()
objectName: account.name
title: account.name
subTitle: WalletUtils.addressToDisplay(account.address, root.getNetworkShortNames(account.preferredSharingChainIds), true, sensor.containsMouse)
asset.color: !!account.colorId ? Utils.getColorForId(account.colorId): ""
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 21:26:26 +00:00
asset.width: 40
asset.height: 40
2022-06-22 12:16:21 +00:00
components: StatusIcon {
2023-02-28 14:54:10 +00:00
icon: "next"
2022-06-22 12:16:21 +00:00
color: Theme.palette.baseColor1
visible: root.nextIconVisible
2022-06-22 12:16:21 +00: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
}
}