2020-08-27 17:28:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import "../imports"
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
font.family: Style.current.fontHexRegular.name
|
2020-09-10 15:31:22 +00:00
|
|
|
elide: expanded ? Text.ElideNone : Text.ElideMiddle
|
2020-08-27 18:02:28 +00:00
|
|
|
color: Style.current.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
|
2020-08-27 18:02:28 +00:00
|
|
|
addressComponent.width = addressComponent.maxWidth > 0 && addressComponent.implicitWidth > addressComponent.maxWidth ?
|
|
|
|
addressComponent.maxWidth :
|
|
|
|
addressComponent.implicitWidth
|
|
|
|
this.width = addressComponent.width
|
2020-08-27 17:28:31 +00:00
|
|
|
}
|
|
|
|
addressComponent.expanded = !addressComponent.expanded
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#ffffff"}
|
|
|
|
}
|
|
|
|
##^##*/
|