OSD: better shadow management

This commit is contained in:
ItsLemmy
2025-11-09 14:46:10 -05:00
parent 43441b44d8
commit 7f141df200

View File

@@ -140,8 +140,8 @@ Variants {
readonly property bool isCentered: (location === "top" || location === "bottom")
readonly property bool verticalMode: (location === "left" || location === "right")
readonly property int hWidth: Math.round(420 * Style.uiScaleRatio)
readonly property int hHeight: Math.round(84 * Style.uiScaleRatio)
readonly property int vWidth: Math.round(92 * Style.uiScaleRatio)
readonly property int hHeight: Math.round(72 * Style.uiScaleRatio)
readonly property int vWidth: Math.round(84 * Style.uiScaleRatio)
readonly property int vHeight: Math.round(380 * Style.uiScaleRatio)
// Ensure an even width to keep the vertical bar perfectly centered
@@ -210,6 +210,10 @@ Variants {
WlrLayershell.layer: (Settings.data.osd && Settings.data.osd.overlayLayer) ? WlrLayer.Overlay : WlrLayer.Top
exclusionMode: PanelWindow.ExclusionMode.Ignore
// Rectangle {
// anchors.fill: parent
// color: "#4400FF00"
// }
Item {
id: osdItem
anchors.fill: parent
@@ -255,7 +259,7 @@ Variants {
Rectangle {
id: background
anchors.fill: parent
anchors.margins: Style.marginM * 2
anchors.margins: Style.marginM * 1.5
radius: Style.radiusL
color: Color.mSurface
border.color: Color.mOutline
@@ -265,17 +269,17 @@ Variants {
}
}
// MultiEffect applied to background only
NDropShadows {
anchors.fill: background
source: background
autoPaddingEnabled: true
}
// Content loader on top of the background (not affected by MultiEffect)
Loader {
id: contentLoader
anchors.fill: parent
anchors.margins: Style.marginL * 2
anchors.fill: background
anchors.margins: Style.marginM
active: true
sourceComponent: panel.verticalMode ? verticalContent : horizontalContent
}