2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2020-08-27 17:28:31 +00:00
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
import utils 1.0
|
2020-08-27 17:28:31 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
property bool expanded: false
|
2020-08-27 18:02:28 +00:00
|
|
|
property int maxWidth: 0
|
2020-08-27 17:28:31 +00:00
|
|
|
property int oldWidth
|
|
|
|
id: addressComponent
|
|
|
|
text: "0x9ce0056c5fc6bb9459a4dcfa35eaad8c1fee5ce9"
|
|
|
|
font.pixelSize: 13
|
2024-10-15 19:26:12 +00:00
|
|
|
font.family: Theme.monoFont.name
|
2021-01-12 20:51:00 +00:00
|
|
|
elide: Text.ElideMiddle
|
2024-10-15 19:26:12 +00:00
|
|
|
color: Theme.palette.secondaryText
|
2020-08-27 17:28:31 +00:00
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: {
|
|
|
|
if (addressComponent.expanded) {
|
|
|
|
addressComponent.width = addressComponent.oldWidth
|
|
|
|
this.width = addressComponent.width
|
|
|
|
} else {
|
|
|
|
addressComponent.oldWidth = addressComponent.width
|
2021-01-12 20:51:00 +00:00
|
|
|
addressComponent.width = addressComponent.maxWidth > 0 ?
|
|
|
|
Math.min(addressComponent.implicitWidth, addressComponent.maxWidth) :
|
2020-08-27 18:02:28 +00:00
|
|
|
addressComponent.implicitWidth
|
|
|
|
this.width = addressComponent.width
|
2020-08-27 17:28:31 +00:00
|
|
|
}
|
|
|
|
addressComponent.expanded = !addressComponent.expanded
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|