Align layout of providers with machine selector

It's quite different in detail because there is a lot less content to show here (no machine type, icons, etc), but the basics are the same now.
One possible issue is that the button doesn't extend all the way to the right, so you can't click everywhere on the shortest item. I'll see if that can still be fixed.

Contributes to issue CURA-8008.
This commit is contained in:
Ghostkeeper 2021-07-09 17:20:32 +02:00
parent f8aa6a3398
commit 739f8834d0
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -85,6 +85,7 @@ Item
contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft
headerCornerSide: Cura.RoundedRectangle.Direction.All headerCornerSide: Cura.RoundedRectangle.Direction.All
headerPadding: Math.round((parent.height - UM.Theme.getSize("button_icon").height) / 2) headerPadding: Math.round((parent.height - UM.Theme.getSize("button_icon").height) / 2)
contentPadding: UM.Theme.getSize("default_lining").width
enabled: visible enabled: visible
height: parent.height height: parent.height
@ -102,8 +103,6 @@ Item
contentItem: Item contentItem: Item
{ {
id: popup id: popup
width: openProviderColumn.width
height: openProviderColumn.height
Column Column
{ {
@ -127,9 +126,11 @@ Item
color: UM.Theme.getColor("text_medium") color: UM.Theme.getColor("text_medium")
font: UM.Theme.getFont("medium") font: UM.Theme.getFont("medium")
renderType: Text.NativeRendering renderType: Text.NativeRendering
verticalAlignment: Text.AlignVCenter
width: contentWidth width: contentWidth
height: contentHeight height: UM.Theme.getSize("action_button").height
leftPadding: UM.Theme.getSize("default_margin").width
} }
Repeater Repeater
@ -152,7 +153,7 @@ Item
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
width: contentWidth width: contentWidth
height: contentHeight height: parent.height
} }
onClicked: onClicked:
@ -171,6 +172,7 @@ Item
{ {
color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent" color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent"
radius: UM.Theme.getSize("action_button_radius").width radius: UM.Theme.getSize("action_button_radius").width
width: popup.width
} }
} }
} }