Use elide instead of truncating descriptions to 235 characters

Just limit it to 3 lines now.

Contributes to issue CURA-5035.
This commit is contained in:
Ruben D 2018-05-02 13:34:24 +02:00
parent 554ebb6617
commit 14466540f5
No known key found for this signature in database
GPG key ID: 6B42C9465E304A62

View file

@ -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")