From 57093f0ef6d003b1ed1757dc99a6d0504e63c13b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 9 Nov 2021 16:34:21 +0100 Subject: [PATCH] Hide Read More button if not truncated There would be nothing to read. Contributes to issue CURA-8561. --- plugins/Marketplace/resources/qml/PackageCard.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/Marketplace/resources/qml/PackageCard.qml b/plugins/Marketplace/resources/qml/PackageCard.qml index 15bb6bcb83..4b1ab78c72 100644 --- a/plugins/Marketplace/resources/qml/PackageCard.qml +++ b/plugins/Marketplace/resources/qml/PackageCard.qml @@ -120,9 +120,9 @@ Rectangle 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 height: authorBy.height //Height of a single line. + visible: descriptionLabel.truncated + enabled: visible leftPadding: UM.Theme.getSize("default_margin").width rightPadding: 0 textFont: descriptionLabel.font