2020-08-27 17:28:31 +00:00
|
|
|
import QtQuick 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2020-08-27 17:28:31 +00:00
|
|
|
|
2021-10-14 13:09:35 +00:00
|
|
|
import "."
|
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
|
|
|
|
font.family: Style.current.fontHexRegular.name
|
2021-01-12 20:51:00 +00:00
|
|
|
elide: 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
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;formeditorColor:"#ffffff"}
|
|
|
|
}
|
|
|
|
##^##*/
|