mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 20:45:54 +08:00
Decent attempt at inlining Read More button
Not perfect yet. The elide is missing, for one. Contributes to issue CURA-8561.
This commit is contained in:
parent
468c2b89e1
commit
c8741898bf
@ -103,24 +103,44 @@ Rectangle
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
height: descriptionLabel.height
|
||||
|
||||
text: packageData.description
|
||||
maximumLineCount: 2
|
||||
wrapMode: Text.Wrap
|
||||
elide: Text.ElideRight //TODO: Make space for Read More button.
|
||||
Label
|
||||
{
|
||||
id: descriptionLabel
|
||||
width: parent.width
|
||||
|
||||
text: packageData.description
|
||||
maximumLineCount: 2
|
||||
wrapMode: Text.Wrap
|
||||
elide: Text.ElideRight
|
||||
|
||||
onLineLaidOut:
|
||||
{
|
||||
if(line.isLast)
|
||||
{
|
||||
line.width = Math.min(line.width, parent.width - readMoreButton.width)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
id: readMoreButton
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
height: authorBy.height //Height of a single line.
|
||||
|
||||
leftPadding: UM.Theme.getSize("default_margin").width
|
||||
rightPadding: 0
|
||||
textFont: descriptionLabel.font
|
||||
|
||||
text: catalog.i18nc("@info", "Read more")
|
||||
}
|
||||
}
|
||||
/*Cura.TertiaryButton
|
||||
{
|
||||
//TODO: Inline in description.
|
||||
|
||||
visible: descriptionLabel.text.length > parent.charLimitSmall
|
||||
text: catalog.i18nc("@info", "Read more")
|
||||
|
||||
// TODO: overlaps elided text, is this ok?
|
||||
}*/
|
||||
|
||||
RowLayout //Author and action buttons.
|
||||
{
|
||||
@ -128,6 +148,7 @@ Rectangle
|
||||
|
||||
Label
|
||||
{
|
||||
id: authorBy
|
||||
Layout.alignment: Qt.AlignTop
|
||||
|
||||
text: catalog.i18nc("@label", "By")
|
||||
|
Loading…
x
Reference in New Issue
Block a user