Notifications: better way to avoid shadow cut-off with autoPadding

This commit is contained in:
ItsLemmy
2025-11-09 14:35:00 -05:00
parent 23a548e034
commit 43441b44d8
2 changed files with 10 additions and 5 deletions
+6 -5
View File
@@ -61,7 +61,7 @@ Variants {
readonly property string barPos: Settings.data.bar.position
readonly property bool isFloating: Settings.data.bar.floating
readonly property int notifWidth: Math.round(420 * Style.uiScaleRatio)
readonly property int notifWidth: Math.round(400 * Style.uiScaleRatio)
// Calculate bar offsets for each edge separately
readonly property int barOffsetTop: {
@@ -99,10 +99,10 @@ Variants {
anchors.right: isRight
// Margins for PanelWindow - only apply bar offset for the specific edge where the bar is
margins.top: isTop ? Style.marginM + barOffsetTop : 0
margins.bottom: isBottom ? Style.marginM + barOffsetBottom : 0
margins.left: isLeft ? Style.marginM + barOffsetLeft : 0
margins.right: isRight ? Style.marginM + barOffsetRight : 0
margins.top: isTop ? barOffsetTop : 0
margins.bottom: isBottom ? barOffsetBottom : 0
margins.left: isLeft ? barOffsetLeft : 0
margins.right: isRight ? barOffsetRight : 0
implicitWidth: notifWidth
implicitHeight: notificationStack.implicitHeight + Style.marginL
@@ -251,6 +251,7 @@ Variants {
NDropShadows {
anchors.fill: cardBackground
source: cardBackground
autoPaddingEnabled: true
}
// Hover handling
+4
View File
@@ -6,8 +6,11 @@ import qs.Services.Power
// Unified shadow system
Item {
id: root
required property var source
property bool autoPaddingEnabled: false
layer.enabled: Settings.data.general.enableShadows && !PowerProfileService.noctaliaPerformanceMode
layer.effect: MultiEffect {
source: root.source
@@ -18,5 +21,6 @@ Item {
shadowColor: Color.black
shadowHorizontalOffset: Settings.data.general.shadowOffsetX
shadowVerticalOffset: Settings.data.general.shadowOffsetY
autoPaddingEnabled: root.autoPaddingEnabled
}
}