mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 23:15:52 +08:00
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:
parent
554ebb6617
commit
14466540f5
@ -40,21 +40,9 @@ Item
|
|||||||
{
|
{
|
||||||
anchors.top: packageName.bottom
|
anchors.top: packageName.bottom
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text:
|
text: model.description
|
||||||
{
|
maximumLineCount: 3
|
||||||
if (model.description.length > 235)
|
elide: Text.ElideRight
|
||||||
{
|
|
||||||
if (model.description.substring(234, 235) == " ")
|
|
||||||
{
|
|
||||||
return model.description.substring(0, 234) + "..."
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return model.description.substring(0, 235) + "..."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return model.description
|
|
||||||
}
|
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user