mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-05-29 17:12:04 +00:00
Notifications: better way to avoid shadow cut-off with autoPadding
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user