Collapse the setting section when the switch for the section is disabled.

Add collapse animation for setting items and setting section.

Swap out ColumnLayout for Layout. Animating the Layouts does not seem to be possible.

I had to put spacer back into the Column but it is the lesser of two evils.

CURA-9793
This commit is contained in:
Joey de l'Arago 2022-12-01 14:03:11 +01:00
parent 574b1000f6
commit 62bae7df19
5 changed files with 118 additions and 27 deletions

View file

@ -1,4 +1,4 @@
//Copyright (c) 2022 Ultimaker B.V.
//Copyright (c) 2022 UltiMaker B.V.
//Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10
@ -18,7 +18,7 @@ Item
function onModeChanged() {}
ColumnLayout
Column
{
spacing: UM.Theme.getSize("default_margin").height
@ -48,7 +48,6 @@ Item
RecommendedResolutionSelector
{
id: recommendedResolutionSelector
Layout.fillWidth: true
width: parent.width
}
@ -56,46 +55,49 @@ Item
{
width: parent.width
visible: !recommendedResolutionSelector.visible
Layout.fillWidth: true
}
Item { height: UM.Theme.getSize("default_margin").height } // Spacer
ProfileWarningReset
{
width: parent.width
Layout.fillWidth: true
Layout.topMargin: UM.Theme.getSize("default_margin").height
Layout.bottomMargin: UM.Theme.getSize("thin_margin").height
}
Item { height: UM.Theme.getSize("thin_margin").height + UM.Theme.getSize("narrow_margin").height} // Spacer
//Line between the sections.
Rectangle
{
width: parent.width
height: UM.Theme.getSize("default_lining").height
Layout.topMargin: UM.Theme.getSize("narrow_margin").height
Layout.bottomMargin: UM.Theme.getSize("narrow_margin").height
Layout.fillWidth: true
color: UM.Theme.getColor("lining")
}
ColumnLayout
{
Item { height: UM.Theme.getSize("narrow_margin").height } //Spacer
Column {
id: settingColumn
width: parent.width
spacing: UM.Theme.getSize("thin_margin").height
RowLayout
Item
{
id: recommendedPrintSettingsHeader
height: childrenRect.height
width: parent.width
UM.Label
{
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
text: catalog.i18nc("@label", "Recommended print settings")
font: UM.Theme.getFont("medium")
}
Item { Layout.fillWidth: true } // Spacer
Cura.SecondaryButton
{
id: customSettingsButton
anchors.top: parent.top
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
text: catalog.i18nc("@button", "Show Custom")
textFont: UM.Theme.getFont("medium_bold")
@ -107,18 +109,15 @@ Item
RecommendedStrengthSelector
{
width: parent.width
Layout.fillWidth: true
}
RecommendedSupportSelector
{
width: parent.width
Layout.fillWidth: true
}
RecommendedAdhesionSelector {
width: parent.width
Layout.fillWidth: true
}
}
}