Merge pull request #1094 from notiant/patch-3

Apply new notification drop shadow to toasts
This commit is contained in:
Lemmy
2025-12-19 16:36:17 -05:00
committed by GitHub
3 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -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
+6 -8
View File
@@ -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: parent
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();
}
}
}
+7 -5
View File
@@ -144,6 +144,8 @@ Item {
readonly property string barPos: Settings.data.bar.position
readonly property bool isFloating: Settings.data.bar.floating
readonly property int shadowPadding: Style.shadowBlurMax + Style.marginL
// Calculate bar offsets for each edge separately
readonly property int barOffsetTop: {
if (barPos !== "top")
@@ -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 {
}
}
}
}
}