diff options
Diffstat (limited to 'modules/notifications/Content.qml')
| -rw-r--r-- | modules/notifications/Content.qml | 112 |
1 files changed, 59 insertions, 53 deletions
diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml index 9a73bc8..341d66e 100644 --- a/modules/notifications/Content.qml +++ b/modules/notifications/Content.qml @@ -16,80 +16,86 @@ 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 - if (visibilities.session) { - const h = panel.session.y - BorderConfig.rounding * 2; - if (height > h) - height = h; - } + model: ScriptModel { + values: [...Notifs.popups].reverse() } - return Math.max(61, Math.min(screen?.height - root.padding * 2 - BorderConfig.thickness * 2, height)); - } + anchors.fill: parent + + implicitHeight: { + let height = (count - 1) * spacing; + for (let i = 0; i < count; i++) + height += itemAtIndex(i)?.nonAnimHeight ?? 0; - orientation: Qt.Vertical - spacing: Appearance.spacing.smaller - cacheBuffer: QsWindow.window?.screen.height ?? 0 - clip: true + 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; + } - delegate: ClippingRectangle { - id: wrapper + 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)); + } - required property Notifs.Notif modelData - readonly property alias nonAnimHeight: notif.nonAnimHeight + orientation: Qt.Vertical + spacing: Appearance.spacing.smaller + cacheBuffer: QsWindow.window?.screen.height ?? 0 - color: "transparent" - radius: notif.radius - implicitWidth: notif.width - implicitHeight: notif.height + delegate: ClippingRectangle { + id: wrapper - Notification { - id: notif + required property Notifs.Notif modelData + readonly property alias nonAnimHeight: notif.nonAnimHeight - modelData: wrapper.modelData + 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 {} + } } } |