Hide Read More button if not truncated

There would be nothing to read.

Contributes to issue CURA-8561.
This commit is contained in:
Ghostkeeper 2021-11-09 16:34:21 +01:00
parent c8741898bf
commit 57093f0ef6
No known key found for this signature in database
GPG Key ID: 68F39EA88EEED5FF

View File

@ -120,9 +120,9 @@ Rectangle
onLineLaidOut: onLineLaidOut:
{ {
if(line.isLast) if(truncated && line.isLast)
{ {
line.width = Math.min(line.width, parent.width - readMoreButton.width) line.width = Math.min(line.width, parent.width - readMoreButton.width);
} }
} }
} }
@ -134,6 +134,8 @@ Rectangle
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
height: authorBy.height //Height of a single line. height: authorBy.height //Height of a single line.
visible: descriptionLabel.truncated
enabled: visible
leftPadding: UM.Theme.getSize("default_margin").width leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: 0 rightPadding: 0
textFont: descriptionLabel.font textFont: descriptionLabel.font