2023-04-18 16:05:24 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
|
|
|
|
|
|
|
import AppLayouts.Wallet 1.0
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
StatusListItem {
|
|
|
|
id: root
|
|
|
|
property var modelData
|
|
|
|
property bool clearVisible: false
|
|
|
|
signal cleared()
|
|
|
|
|
|
|
|
implicitHeight: visible ? 64 : 0
|
|
|
|
title: !!modelData ? modelData.name: ""
|
|
|
|
subTitle: {
|
|
|
|
if(!!modelData) {
|
|
|
|
if (modelData.ens.length > 0) {
|
|
|
|
return sensor.containsMouse ? Utils.richColorText(modelData.ens, Theme.palette.directColor1) : modelData.ens
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
let elidedAddress = StatusQUtils.Utils.elideText(modelData.address,6,4)
|
|
|
|
return sensor.containsMouse ? WalletUtils.colorizedChainPrefix(modelData.chainShortNames) + Utils.richColorText(elidedAddress, Theme.palette.directColor1): modelData.chainShortNames + elidedAddress
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
statusListItemSubTitle.elide: Text.ElideMiddle
|
|
|
|
statusListItemSubTitle.wrapMode: Text.NoWrap
|
|
|
|
radius: 0
|
2023-04-24 18:35:34 +00:00
|
|
|
color: sensor.containsMouse || highlighted ? Theme.palette.baseColor2 : "transparent"
|
2023-04-18 16:05:24 +00:00
|
|
|
components: [
|
|
|
|
ClearButton {
|
|
|
|
width: 24
|
|
|
|
height: 24
|
|
|
|
visible: root.clearVisible
|
|
|
|
onClicked: root.cleared()
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|