Use anchors instead of setting the width

Fixes review comment https://github.com/Ultimaker/Cura/pull/10491#discussion_r713119985.

CURA-8421
This commit is contained in:
Konstantinos Karmas 2021-09-21 17:32:06 +02:00
parent 2f75e299f5
commit c73f815b69

View File

@ -35,7 +35,9 @@ Button
Column Column
{ {
id: applicationButtonContent id: applicationButtonContent
anchors.centerIn: parent anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
UM.RecolorImage UM.RecolorImage
{ {
@ -87,9 +89,9 @@ Button
{ {
id: applicationDisplayName id: applicationDisplayName
anchors.horizontalCenter: parent.horizontalCenter anchors.left: parent.left
anchors.right: parent.right
width: base.width - UM.Theme.getSize("default_margin").width
height: base.height - applicationIcon.height - 2 * UM.Theme.getSize("default_margin").width // Account for the top and bottom margins height: base.height - applicationIcon.height - 2 * UM.Theme.getSize("default_margin").width // Account for the top and bottom margins
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter