From cb6eaaa25a61b0e14a3d2f120e4cbfef6551a1d0 Mon Sep 17 00:00:00 2001 From: ATMDA Date: Tue, 11 Nov 2025 16:22:14 -0500 Subject: controlcenter: desktop selector in appearance panel font styling --- .../controlcenter/appearance/AppearancePane.qml | 70 ++++++++++++++++++++-- 1 file changed, 65 insertions(+), 5 deletions(-) (limited to 'modules/controlcenter') diff --git a/modules/controlcenter/appearance/AppearancePane.qml b/modules/controlcenter/appearance/AppearancePane.qml index d50eb58..e3600ed 100644 --- a/modules/controlcenter/appearance/AppearancePane.qml +++ b/modules/controlcenter/appearance/AppearancePane.qml @@ -2045,16 +2045,76 @@ RowLayout { } } + // 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 + + 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) } + } + + opacity: 0 + + Behavior on opacity { + NumberAnimation { + duration: 200 + easing.type: Easing.OutCubic + } + } + + Component.onCompleted: { + opacity = 1; + } + } + StyledText { + id: filenameText anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom - anchors.margins: Appearance.padding.small + anchors.leftMargin: Appearance.padding.normal + anchors.rightMargin: Appearance.padding.normal + anchors.bottomMargin: Appearance.padding.normal + + readonly property string fileName: { + const path = modelData.relativePath || ""; + const parts = path.split("/"); + return parts.length > 0 ? parts[parts.length - 1] : path; + } - text: modelData.relativePath - font.pointSize: Appearance.font.size.small - color: isCurrent ? Colours.palette.m3primary : Colours.palette.m3onSurface - elide: Text.ElideRight + text: fileName + font.pointSize: Appearance.font.size.smaller + font.weight: 500 + color: isCurrent ? Colours.palette.m3primary : "#FFFFFF" + 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 { + NumberAnimation { + duration: 200 + easing.type: Easing.OutCubic + } + } + + Component.onCompleted: { + opacity = 1; + } } } } -- cgit v1.2.3-freya