Align everything to top

This seems to be the alignment in the design. Also gets rid of binding loops because we automatically adjust the height so you can't align to the centre or the bottom then.

Contributes to issue CURA-8561.
This commit is contained in:
Ghostkeeper 2021-11-09 15:58:37 +01:00
parent abe8347523
commit 8c086b9fd7
No known key found for this signature in database
GPG Key ID: 68F39EA88EEED5FF

View File

@ -31,6 +31,7 @@ Rectangle
{ {
Layout.preferredWidth: UM.Theme.getSize("card_icon").width Layout.preferredWidth: UM.Theme.getSize("card_icon").width
Layout.preferredHeight: UM.Theme.getSize("card_icon").height Layout.preferredHeight: UM.Theme.getSize("card_icon").height
Layout.alignment: Qt.AlignTop
source: packageData.iconUrl != "" ? packageData.iconUrl : "../images/placeholder.svg" source: packageData.iconUrl != "" ? packageData.iconUrl : "../images/placeholder.svg"
} }
@ -39,6 +40,7 @@ Rectangle
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: childrenRect.height Layout.preferredHeight: childrenRect.height
Layout.alignment: Qt.AlignTop
spacing: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height
@ -50,6 +52,8 @@ Rectangle
Label Label
{ {
Layout.alignment: Qt.AlignTop
font: UM.Theme.getFont("medium_bold") font: UM.Theme.getFont("medium_bold")
color: UM.Theme.getColor("text") color: UM.Theme.getColor("text")
@ -60,6 +64,7 @@ Rectangle
{ {
Layout.preferredWidth: visible ? UM.Theme.getSize("section_icon").width : 0 Layout.preferredWidth: visible ? UM.Theme.getSize("section_icon").width : 0
Layout.preferredHeight: visible ? UM.Theme.getSize("section_icon").height : 0 Layout.preferredHeight: visible ? UM.Theme.getSize("section_icon").height : 0
Layout.alignment: Qt.AlignTop
color: UM.Theme.getColor("icon") color: UM.Theme.getColor("icon")
visible: packageData.isVerified visible: packageData.isVerified
@ -72,6 +77,7 @@ Rectangle
{ // placeholder for 'certified material' icon+link whenever we implement the materials part of this card { // placeholder for 'certified material' icon+link whenever we implement the materials part of this card
Layout.preferredWidth: visible ? UM.Theme.getSize("section_icon").width : 0 Layout.preferredWidth: visible ? UM.Theme.getSize("section_icon").width : 0
Layout.preferredHeight: visible ? UM.Theme.getSize("section_icon").height : 0 Layout.preferredHeight: visible ? UM.Theme.getSize("section_icon").height : 0
Layout.alignment: Qt.AlignTop
// TODO: on hover // TODO: on hover
} }
@ -79,6 +85,7 @@ Rectangle
Label Label
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
text: packageData.packageVersion text: packageData.packageVersion
} }
@ -87,6 +94,7 @@ Rectangle
{ {
Layout.preferredWidth: UM.Theme.getSize("section_icon").width Layout.preferredWidth: UM.Theme.getSize("section_icon").width
Layout.preferredHeight: UM.Theme.getSize("section_icon").height Layout.preferredHeight: UM.Theme.getSize("section_icon").height
Layout.alignment: Qt.AlignTop
color: UM.Theme.getColor("icon") color: UM.Theme.getColor("icon")
source: UM.Theme.getIcon("Link") source: UM.Theme.getIcon("Link")
@ -119,12 +127,15 @@ Rectangle
Label Label
{ {
Layout.alignment: Qt.AlignTop
text: catalog.i18nc("@label", "By") text: catalog.i18nc("@label", "By")
} }
Cura.TertiaryButton Cura.TertiaryButton
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
text: packageData.authorName text: packageData.authorName