Align dropdown in open project dialog

CURA-9424
This commit is contained in:
c.lamboo 2022-11-09 15:55:48 +01:00
parent 948ac84070
commit 95e0021cce
2 changed files with 8 additions and 4 deletions

View file

@ -111,9 +111,8 @@ UM.Dialog
{
id: machineSelector
headerCornerSide: Cura.RoundedRectangle.Direction.All
width: UM.Theme.getSize("machine_selector_widget").width
width: parent.width
height: parent.height
anchors.centerIn: parent
machineListModel: manager.updatableMachinesModel
machineName: manager.machineName
@ -122,6 +121,8 @@ UM.Dialog
isCloudRegistered: false
isGroup: false
minDropDownWidth: machineSelector.width
buttons: [
Cura.SecondaryButton
{

View file

@ -198,11 +198,14 @@ Cura.ExpandablePopup
}
}
property int minDropDownWidth: UM.Theme.getSize("machine_selector_widget_content").width
property int maxDropDownHeight: UM.Theme.getSize("machine_selector_widget_content").height
contentItem: Item
{
id: popup
implicitWidth: Math.max(machineSelector.width, UM.Theme.getSize("machine_selector_widget_content").width)
implicitHeight: Math.min(machineSelectorList.contentHeight + separator.height + buttonRow.height, UM.Theme.getSize("machine_selector_widget_content").height) //Maximum height is the theme entry.
implicitWidth: Math.max(machineSelector.width, minDropDownWidth)
implicitHeight: Math.min(machineSelectorList.contentHeight + separator.height + buttonRow.height, maxDropDownHeight) //Maximum height is the theme entry.
MachineSelectorList
{
id: machineSelectorList