controlcenter: clip/fade issue on certain collapsiblesections

This commit is contained in:
ATMDA 2025-11-16 15:09:58 -05:00
parent 8a33ad9905
commit 18d117557a

View file

@ -70,8 +70,15 @@ ColumnLayout {
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: (root.expanded && root.description !== "") ? descriptionText.implicitHeight + Appearance.spacing.smaller + Appearance.spacing.small : 0 Layout.preferredHeight: (root.expanded && root.description !== "") ? Math.min(descriptionText.implicitHeight + Appearance.spacing.smaller + Appearance.spacing.small, maxDescriptionHeight) : 0
clip: true
readonly property real maxDescriptionHeight: 60
layer.enabled: true
layer.smooth: true
layer.effect: OpacityMask {
maskSource: descriptionMask
}
Behavior on Layout.preferredHeight { Behavior on Layout.preferredHeight {
Anim { Anim {
@ -79,6 +86,34 @@ ColumnLayout {
} }
} }
Item {
id: descriptionMask
anchors.fill: parent
layer.enabled: true
visible: false
Rectangle {
anchors.fill: parent
gradient: Gradient {
orientation: Gradient.Vertical
GradientStop {
position: 0.0
color: Qt.rgba(0, 0, 0, 1)
}
GradientStop {
position: 0.7
color: Qt.rgba(0, 0, 0, 1)
}
GradientStop {
position: 1.0
color: Qt.rgba(0, 0, 0, 0)
}
}
}
}
StyledText { StyledText {
id: descriptionText id: descriptionText
anchors.left: parent.left anchors.left: parent.left
@ -90,6 +125,7 @@ ColumnLayout {
text: root.description text: root.description
color: Colours.palette.m3onSurfaceVariant color: Colours.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.small font.pointSize: Appearance.font.size.small
wrapMode: Text.Wrap
opacity: (root.expanded && root.description !== "") ? 1.0 : 0.0 opacity: (root.expanded && root.description !== "") ? 1.0 : 0.0
Behavior on opacity { Behavior on opacity {