controlcenter: fix wallpaper gradient overlay

This commit is contained in:
2 * r + 2 * t 2025-11-15 17:43:03 +11:00
parent 56ed76e183
commit 266cffe342

View file

@ -48,15 +48,24 @@ RowLayout {
spacing: 0
function collapseAllSections(exceptSection) {
if (exceptSection !== themeModeSection) themeModeSection.expanded = false;
if (exceptSection !== colorVariantSection) colorVariantSection.expanded = false;
if (exceptSection !== colorSchemeSection) colorSchemeSection.expanded = false;
if (exceptSection !== animationsSection) animationsSection.expanded = false;
if (exceptSection !== fontsSection) fontsSection.expanded = false;
if (exceptSection !== scalesSection) scalesSection.expanded = false;
if (exceptSection !== transparencySection) transparencySection.expanded = false;
if (exceptSection !== borderSection) borderSection.expanded = false;
if (exceptSection !== backgroundSection) backgroundSection.expanded = false;
if (exceptSection !== themeModeSection)
themeModeSection.expanded = false;
if (exceptSection !== colorVariantSection)
colorVariantSection.expanded = false;
if (exceptSection !== colorSchemeSection)
colorSchemeSection.expanded = false;
if (exceptSection !== animationsSection)
animationsSection.expanded = false;
if (exceptSection !== fontsSection)
fontsSection.expanded = false;
if (exceptSection !== scalesSection)
scalesSection.expanded = false;
if (exceptSection !== transparencySection)
transparencySection.expanded = false;
if (exceptSection !== borderSection)
borderSection.expanded = false;
if (exceptSection !== backgroundSection)
backgroundSection.expanded = false;
}
function saveConfig() {
@ -948,10 +957,7 @@ RowLayout {
anchors.fill: parent
// Ensure sourceSize is always set to valid dimensions
sourceSize: Qt.size(
Math.max(1, Math.floor(parent.width)),
Math.max(1, Math.floor(parent.height))
)
sourceSize: Qt.size(Math.max(1, Math.floor(parent.width)), Math.max(1, Math.floor(parent.height)))
// Show when ready, hide if fallback is showing
opacity: status === Image.Ready && !fallbackImage.visible ? 1 : 0
@ -971,10 +977,7 @@ RowLayout {
source: modelData.path
asynchronous: true
fillMode: Image.PreserveAspectCrop
sourceSize: Qt.size(
Math.max(1, Math.floor(parent.width)),
Math.max(1, Math.floor(parent.height))
)
sourceSize: Qt.size(Math.max(1, Math.floor(parent.width)), Math.max(1, Math.floor(parent.height)))
// Show if caching image hasn't loaded after a delay
visible: opacity > 0
@ -1019,24 +1022,35 @@ RowLayout {
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.large
}
}
// Gradient overlay for filename with rounded bottom corners
Rectangle {
id: filenameOverlay
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: filenameText.implicitHeight + Appearance.padding.normal * 2
// Match the parent's rounded corners at the bottom
radius: Appearance.rounding.normal
implicitHeight: filenameText.implicitHeight + Appearance.padding.normal * 2
gradient: Gradient {
GradientStop { position: 0.0; color: Qt.rgba(0, 0, 0, 0) }
GradientStop { position: 0.3; color: Qt.rgba(0, 0, 0, 0.3) }
GradientStop { position: 0.7; color: Qt.rgba(0, 0, 0, 0.75) }
GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, 0.85) }
GradientStop {
position: 0.0
color: Qt.rgba(0, 0, 0, 0)
}
GradientStop {
position: 0.3
color: Qt.rgba(0, 0, 0, 0.3)
}
GradientStop {
position: 0.7
color: Qt.rgba(0, 0, 0, 0.75)
}
GradientStop {
position: 1.0
color: Qt.rgba(0, 0, 0, 0.85)
}
}
}
opacity: 0
@ -1075,10 +1089,6 @@ RowLayout {
elide: Text.ElideMiddle
maximumLineCount: 1
// Text shadow for better readability
style: Text.Outline
styleColor: Qt.rgba(0, 0, 0, 0.6)
opacity: 0
Behavior on opacity {
@ -1103,5 +1113,3 @@ RowLayout {
}
}
}