Don't stretch in height and adhere border to UX design

Contributes to CURA-8689
This commit is contained in:
jspijker 2022-11-08 18:17:41 +01:00
parent 00bdd9d72c
commit f0966b1c57
2 changed files with 7 additions and 3 deletions

View File

@ -50,6 +50,8 @@ Control
PrinterCard PrinterCard
{ {
id: ultimakerPrinterCard id: ultimakerPrinterCard
Layout.alignment: Qt.AlignBottom
borderHeight: thrirdPartyPrinterCard.height
onClicked: goToUltimakerPrinter onClicked: goToUltimakerPrinter
text: catalog.i18nc("@button", "Ultimaker printer") text: catalog.i18nc("@button", "Ultimaker printer")
imageSource: UM.Theme.getImage("ultimaker_printer") imageSource: UM.Theme.getImage("ultimaker_printer")
@ -58,6 +60,7 @@ Control
PrinterCard PrinterCard
{ {
id: thrirdPartyPrinterCard id: thrirdPartyPrinterCard
Layout.alignment: Qt.AlignBottom
onClicked: goToThirdPartyPrinter onClicked: goToThirdPartyPrinter
text: catalog.i18nc("@button", "Non Ultimaker printer") text: catalog.i18nc("@button", "Non Ultimaker printer")
imageSource: UM.Theme.getImage("third_party_printer") imageSource: UM.Theme.getImage("third_party_printer")

View File

@ -13,6 +13,7 @@ Control
id: root id: root
property alias text: link_text.text property alias text: link_text.text
property alias imageSource: image.source property alias imageSource: image.source
property alias borderHeight: background.height
property var onClicked property var onClicked
states: states:
@ -42,7 +43,6 @@ Control
onClicked: root.onClicked && root.onClicked() onClicked: root.onClicked && root.onClicked()
} }
topPadding: UM.Theme.getSize("wide_margin").height
rightPadding: UM.Theme.getSize("wide_margin").width rightPadding: UM.Theme.getSize("wide_margin").width
bottomPadding: UM.Theme.getSize("wide_margin").height bottomPadding: UM.Theme.getSize("wide_margin").height
leftPadding: UM.Theme.getSize("wide_margin").width leftPadding: UM.Theme.getSize("wide_margin").width
@ -50,7 +50,8 @@ Control
background: Rectangle background: Rectangle
{ {
id: background id: background
anchors.fill: parent anchors.bottom: column.bottom
height: parent.height
border.color: UM.Theme.getColor("primary_button") border.color: UM.Theme.getColor("primary_button")
color: "transparent" color: "transparent"
border.width: 1 border.width: 1
@ -59,6 +60,7 @@ Control
contentItem: ColumnLayout contentItem: ColumnLayout
{ {
id: column
spacing: UM.Theme.getSize("wide_margin").height spacing: UM.Theme.getSize("wide_margin").height
height: childrenRect.height height: childrenRect.height
width: childrenRect.width width: childrenRect.width
@ -68,7 +70,6 @@ Control
id: image id: image
source: imageSource source: imageSource
width: 180 * screenScaleFactor width: 180 * screenScaleFactor
height: 180 * screenScaleFactor
sourceSize.width: width sourceSize.width: width
sourceSize.height: height sourceSize.height: height
} }