From 5f3864afbad3b2cf8571843d1b11d3535cb33a2d Mon Sep 17 00:00:00 2001 From: Damocles Date: Sun, 12 Apr 2026 17:04:30 +0200 Subject: [PATCH] fix bar group glow to not affect content text --- modules/BarGroup.qml | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/modules/BarGroup.qml b/modules/BarGroup.qml index 9f42a7d..878e38d 100644 --- a/modules/BarGroup.qml +++ b/modules/BarGroup.qml @@ -2,20 +2,33 @@ import QtQuick import QtQuick.Effects import "." as M -Rectangle { +Item { id: root default property alias content: row.children property color borderColor: M.Theme.base02 - color: "transparent" - border.color: borderColor - border.width: 1 - radius: M.Theme.radius visible: row.visibleChildren.length > 0 - layer.enabled: true - layer.effect: MultiEffect { + implicitWidth: row.implicitWidth + _pad * 2 + implicitHeight: row.implicitHeight + _pad * 2 + + readonly property int _pad: 6 + + // Shadow source — rendered offscreen, only its glow is visible + Rectangle { + id: shadowSource + anchors.fill: parent + color: "transparent" + border.color: root.borderColor + border.width: 1 + radius: M.Theme.radius + visible: false + } + + MultiEffect { + source: shadowSource + anchors.fill: shadowSource shadowEnabled: true shadowColor: root.borderColor shadowBlur: 0.6 @@ -23,10 +36,14 @@ Rectangle { shadowHorizontalOffset: 0 } - implicitWidth: row.implicitWidth + _pad * 2 - implicitHeight: row.implicitHeight + _pad * 2 - - readonly property int _pad: 6 + // Visible border (on top of the glow) + Rectangle { + anchors.fill: parent + color: "transparent" + border.color: root.borderColor + border.width: 1 + radius: M.Theme.radius + } Row { id: row