controlcenter: clip/fade issue on certain collapsiblesections
This commit is contained in:
parent
8a33ad9905
commit
18d117557a
1 changed files with 38 additions and 2 deletions
|
|
@ -70,8 +70,15 @@ ColumnLayout {
|
|||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: (root.expanded && root.description !== "") ? descriptionText.implicitHeight + Appearance.spacing.smaller + Appearance.spacing.small : 0
|
||||
clip: true
|
||||
Layout.preferredHeight: (root.expanded && root.description !== "") ? Math.min(descriptionText.implicitHeight + Appearance.spacing.smaller + Appearance.spacing.small, maxDescriptionHeight) : 0
|
||||
|
||||
readonly property real maxDescriptionHeight: 60
|
||||
|
||||
layer.enabled: true
|
||||
layer.smooth: true
|
||||
layer.effect: OpacityMask {
|
||||
maskSource: descriptionMask
|
||||
}
|
||||
|
||||
Behavior on Layout.preferredHeight {
|
||||
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 {
|
||||
id: descriptionText
|
||||
anchors.left: parent.left
|
||||
|
|
@ -90,6 +125,7 @@ ColumnLayout {
|
|||
text: root.description
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
font.pointSize: Appearance.font.size.small
|
||||
wrapMode: Text.Wrap
|
||||
opacity: (root.expanded && root.description !== "") ? 1.0 : 0.0
|
||||
|
||||
Behavior on opacity {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue