From 14466540f58e0c6c1d9fb51aa3362acbda000a10 Mon Sep 17 00:00:00 2001 From: Ruben D Date: Wed, 2 May 2018 13:34:24 +0200 Subject: [PATCH] Use elide instead of truncating descriptions to 235 characters Just limit it to 3 lines now. Contributes to issue CURA-5035. --- .../resources/qml/ToolboxDetailTile.qml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index 768f382082..b81e511cc6 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -40,21 +40,9 @@ Item { anchors.top: packageName.bottom width: parent.width - text: - { - if (model.description.length > 235) - { - if (model.description.substring(234, 235) == " ") - { - return model.description.substring(0, 234) + "..." - } - else - { - return model.description.substring(0, 235) + "..." - } - } - return model.description - } + text: model.description + maximumLineCount: 3 + elide: Text.ElideRight wrapMode: Text.WordWrap color: UM.Theme.getColor("text") font: UM.Theme.getFont("default")