diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml index 9a73bc88..341d66e7 100644 --- a/modules/notifications/Content.qml +++ b/modules/notifications/Content.qml @@ -16,81 +16,87 @@ Item { implicitWidth: NotifsConfig.sizes.width + root.padding * 2 implicitHeight: list.implicitHeight + root.padding * 2 - ListView { - id: list - - model: ScriptModel { - values: [...Notifs.popups].reverse() - } - + ClippingWrapperRectangle { anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right anchors.margins: root.padding - implicitHeight: { - let height = (count - 1) * spacing; - for (let i = 0; i < count; i++) - height += itemAtIndex(i)?.nonAnimHeight ?? 0; + color: "transparent" + radius: Appearance.rounding.normal - const screen = QsWindow.window?.screen; - const visibilities = Visibilities.screens[screen]; - const panel = Visibilities.panels[screen]; - if (visibilities && panel) { - if (visibilities.osd) { - const h = panel.osd.y - BorderConfig.rounding * 2; - if (height > h) - height = h; + ListView { + id: list + + model: ScriptModel { + values: [...Notifs.popups].reverse() + } + + anchors.fill: parent + + implicitHeight: { + let height = (count - 1) * spacing; + for (let i = 0; i < count; i++) + height += itemAtIndex(i)?.nonAnimHeight ?? 0; + + const screen = QsWindow.window?.screen; + const visibilities = Visibilities.screens[screen]; + const panel = Visibilities.panels[screen]; + if (visibilities && panel) { + if (visibilities.osd) { + const h = panel.osd.y - BorderConfig.rounding * 2; + if (height > h) + height = h; + } + + if (visibilities.session) { + const h = panel.session.y - BorderConfig.rounding * 2; + if (height > h) + height = h; + } } - if (visibilities.session) { - const h = panel.session.y - BorderConfig.rounding * 2; - if (height > h) - height = h; + return Math.max(61, Math.min((screen?.height ?? 0) - root.padding * 2 - BorderConfig.thickness * 2, height)); + } + + orientation: Qt.Vertical + spacing: Appearance.spacing.smaller + cacheBuffer: QsWindow.window?.screen.height ?? 0 + + delegate: ClippingRectangle { + id: wrapper + + required property Notifs.Notif modelData + readonly property alias nonAnimHeight: notif.nonAnimHeight + + color: "transparent" + radius: notif.radius + implicitWidth: notif.width + implicitHeight: notif.height + + Notification { + id: notif + + modelData: wrapper.modelData } } - return Math.max(61, Math.min(screen?.height - root.padding * 2 - BorderConfig.thickness * 2, height)); - } - - orientation: Qt.Vertical - spacing: Appearance.spacing.smaller - cacheBuffer: QsWindow.window?.screen.height ?? 0 - clip: true - - delegate: ClippingRectangle { - id: wrapper - - required property Notifs.Notif modelData - readonly property alias nonAnimHeight: notif.nonAnimHeight - - color: "transparent" - radius: notif.radius - implicitWidth: notif.width - implicitHeight: notif.height - - Notification { - id: notif - - modelData: wrapper.modelData + move: Transition { + Anim { + property: "y" + } } - } - move: Transition { - Anim { - property: "y" + displaced: Transition { + Anim { + property: "y" + } } - } - displaced: Transition { - Anim { - property: "y" + Behavior on implicitHeight { + Anim {} } } - - Behavior on implicitHeight { - Anim {} - } } component Anim: NumberAnimation {