Make the width of the ProfileWarningREset 0 when it is hidden.

Expand the profile selection dropdown when the ProfileWarningReset is hidden in the custom menu.
CURA-9793
This commit is contained in:
Joey de l'Arago 2022-12-06 18:11:15 +01:00
parent 4ecc0a98bb
commit 03fac1bc7f
2 changed files with 13 additions and 8 deletions

View file

@ -52,9 +52,13 @@ Item
id: intentSelection
onClicked: menu.opened ? menu.close() : menu.open()
anchors.right: profileWarningReset.left
anchors.rightMargin: UM.Theme.getSize("narrow_margin").width
width: UM.Theme.getSize("print_setup_big_item").width - profileWarningReset.width
// Anchoring to the right makes much more sense here, but for some reason this component compresses from the right
// and then expands from the left afterwards. This pushes it left by profileWarningReset.width
// The solution is to anchor from the other direction so this does not happen.
anchors.left: parent.left
// This leftMargin gives us the same spacing as anchoring to the right on profileWarningReset
anchors.leftMargin: parent.width - UM.Theme.getSize("print_setup_big_item").width
width: profileWarningReset.visible ? UM.Theme.getSize("print_setup_big_item").width - profileWarningReset.width - UM.Theme.getSize("default_margin").width : UM.Theme.getSize("print_setup_big_item").width
height: textLabel.contentHeight + 2 * UM.Theme.getSize("narrow_margin").height
hoverEnabled: true