From 483a6fe8e4297d56e9f4dc5cb33c046520edc538 Mon Sep 17 00:00:00 2001 From: ATMDA Date: Sat, 15 Nov 2025 21:54:33 -0500 Subject: controlcenter: collapsible section sub heading animation correction --- components/controls/CollapsibleSection.qml | 39 +++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/components/controls/CollapsibleSection.qml b/components/controls/CollapsibleSection.qml index 600b662..e1cd35f 100644 --- a/components/controls/CollapsibleSection.qml +++ b/components/controls/CollapsibleSection.qml @@ -68,16 +68,37 @@ ColumnLayout { } } - StyledText { - visible: root.expanded && root.description !== "" + Item { + visible: root.description !== "" Layout.fillWidth: true - Layout.leftMargin: Appearance.padding.normal - Layout.rightMargin: Appearance.padding.normal - Layout.topMargin: Appearance.spacing.smaller - Layout.bottomMargin: Appearance.spacing.small - text: root.description - color: Colours.palette.m3onSurfaceVariant - font.pointSize: Appearance.font.size.small + Layout.preferredHeight: root.expanded ? descriptionText.implicitHeight + Appearance.spacing.smaller + Appearance.spacing.small : 0 + clip: true + + Behavior on Layout.preferredHeight { + Anim { + easing.bezierCurve: Appearance.anim.curves.standard + } + } + + StyledText { + id: descriptionText + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.leftMargin: Appearance.padding.normal + anchors.rightMargin: Appearance.padding.normal + anchors.topMargin: Appearance.spacing.smaller + text: root.description + color: Colours.palette.m3onSurfaceVariant + font.pointSize: Appearance.font.size.small + opacity: root.expanded ? 1.0 : 0.0 + + Behavior on opacity { + Anim { + easing.bezierCurve: Appearance.anim.curves.standard + } + } + } } default property alias content: contentColumn.data -- cgit v1.2.3-freya