mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Apply new notification drop shadow to toasts
This commit is contained in:
@@ -179,7 +179,7 @@ Variants {
|
||||
readonly property int slideDistance: 300
|
||||
|
||||
Layout.preferredWidth: notifWidth + notifWindow.shadowPadding * 2
|
||||
Layout.preferredHeight: notificationContent.implicitHeight + Style.marginL * 2 + notifWindow.shadowPadding * 2
|
||||
Layout.preferredHeight: notificationContent.implicitHeight + Style.marginM * 2 + notifWindow.shadowPadding * 2
|
||||
Layout.maximumHeight: Layout.preferredHeight
|
||||
|
||||
// Animation properties
|
||||
|
||||
@@ -16,11 +16,12 @@ Item {
|
||||
|
||||
signal hidden
|
||||
|
||||
readonly property int notificationWidth: Math.round(400 * Style.uiScaleRatio)
|
||||
readonly property int notificationWidth: Math.round(440 * Style.uiScaleRatio)
|
||||
readonly property int shadowPadding: Style.shadowBlurMax + Style.marginL
|
||||
|
||||
// Use exact notification width to match notifications precisely
|
||||
width: notificationWidth
|
||||
height: Math.round(contentLayout.implicitHeight + Style.marginM * 3 * 2)
|
||||
height: Math.round(contentLayout.implicitHeight + Style.marginM * 2 * 2 + shadowPadding * 2)
|
||||
visible: true
|
||||
opacity: 0
|
||||
scale: initialScale
|
||||
@@ -29,7 +30,7 @@ Item {
|
||||
Rectangle {
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginM
|
||||
anchors.margins: shadowPadding
|
||||
radius: Style.radiusL
|
||||
color: Qt.alpha(Color.mSurface, Settings.data.notifications.backgroundOpacity || 1.0)
|
||||
|
||||
@@ -95,13 +96,10 @@ Item {
|
||||
|
||||
RowLayout {
|
||||
id: contentLayout
|
||||
anchors.top: parent.top
|
||||
anchors.fill: background
|
||||
anchors.topMargin: Style.marginM
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: Style.marginM
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Style.marginM * 3
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Style.marginM * 3
|
||||
spacing: Style.marginL
|
||||
|
||||
@@ -198,4 +196,4 @@ Item {
|
||||
root.visible = false;
|
||||
root.hidden();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,6 +172,8 @@ Item {
|
||||
const floatMarginH = isFloating ? Math.ceil(Settings.data.bar.marginHorizontal * Style.marginXL) : 0;
|
||||
return Style.barHeight + floatMarginH;
|
||||
}
|
||||
|
||||
readonly property int shadowPadding: Style.shadowBlurMax + Style.marginL
|
||||
|
||||
// Anchoring
|
||||
anchors.top: isTop
|
||||
@@ -180,10 +182,10 @@ Item {
|
||||
anchors.right: isRight
|
||||
|
||||
// Margins for PanelWindow - only apply bar offset for the specific edge where the bar is
|
||||
margins.top: isTop ? barOffsetTop : 0
|
||||
margins.bottom: isBottom ? barOffsetBottom : 0
|
||||
margins.left: isLeft ? barOffsetLeft : 0
|
||||
margins.right: isRight ? barOffsetRight : 0
|
||||
margins.top: isTop ? barOffsetTop - shadowPadding + Style.marginM : 0
|
||||
margins.bottom: isBottom ? barOffsetBottom - shadowPadding + Style.marginM : 0
|
||||
margins.left: isLeft ? barOffsetLeft - shadowPadding + Style.marginM : 0
|
||||
margins.right: isRight ? barOffsetRight - shadowPadding + Style.marginM : 0
|
||||
|
||||
implicitWidth: Math.round(toastItem.width)
|
||||
implicitHeight: Math.round(toastItem.height)
|
||||
@@ -210,4 +212,4 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user