Change card summary information into a column

This is necessary because we can't anchor to the bottom of the card here, and because we want to swap out the description for a download count in the extended detail card.

Contributes to issue CURA-8565.
This commit is contained in:
Ghostkeeper 2021-11-29 17:40:53 +01:00
parent 8ecd2f86a4
commit d7058ef520
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -57,19 +57,25 @@ Rectangle
source: packageData.iconUrl != "" ? packageData.iconUrl : "../images/placeholder.svg" source: packageData.iconUrl != "" ? packageData.iconUrl : "../images/placeholder.svg"
} }
ColumnLayout
{
anchors
{
left: packageItem.right
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("thick_margin").width
top: parent.top
topMargin: UM.Theme.getSize("narrow_margin").height
}
height: packageItem.height + packageItem.anchors.margins * 2
// Title row. // Title row.
RowLayout RowLayout
{ {
id: titleBar id: titleBar
anchors Layout.preferredWidth: parent.width
{ Layout.preferredHeight: childrenRect.height
left: packageItem.right
right: parent.right
top: parent.top
topMargin: UM.Theme.getSize("narrow_margin").height
leftMargin: UM.Theme.getSize("default_margin").width
rightMargin:UM.Theme.getSize("thick_margin").width
}
Label Label
{ {
@ -182,21 +188,14 @@ Rectangle
} }
onClicked: Qt.openUrlExternally(packageData.authorInfoUrl) onClicked: Qt.openUrlExternally(packageData.authorInfoUrl)
} }
} }
Item Item
{ {
id: descriptionArea id: descriptionArea
height: descriptionLabel.height Layout.preferredWidth: parent.width
anchors Layout.fillHeight: true
{
top: titleBar.bottom
left: packageItem.right
right: parent.right
rightMargin: UM.Theme.getSize("default_margin").width
leftMargin: UM.Theme.getSize("default_margin").width
}
Label Label
{ {
id: descriptionLabel id: descriptionLabel
@ -242,7 +241,7 @@ Rectangle
Cura.TertiaryButton Cura.TertiaryButton
{ {
id: readMoreButton id: readMoreButton
anchors.left: tripleDotLabel.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
height: fontMetrics.height //Height of a single line. height: fontMetrics.height //Height of a single line.
@ -264,13 +263,9 @@ Rectangle
RowLayout RowLayout
{ {
id: authorAndActionButton id: authorAndActionButton
width: parent.width Layout.preferredWidth: parent.width
anchors Layout.preferredHeight: childrenRect.height
{
bottom: parent.bottom
left: packageItem.right
margins: UM.Theme.getSize("default_margin").height
}
spacing: UM.Theme.getSize("narrow_margin").width spacing: UM.Theme.getSize("narrow_margin").width
Label Label
@ -324,6 +319,7 @@ Rectangle
visible: false // not functional right now, also only when unfolding and required visible: false // not functional right now, also only when unfolding and required
} }
} }
}
FontMetrics FontMetrics
{ {