From c3e8127422c7439d9ddb07e3634c892abb7b53f4 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 9 Jul 2025 21:57:44 +1000 Subject: internal: pass around visibilities Instead of singleton Also for panels --- modules/notifications/Content.qml | 7 +++---- modules/notifications/Wrapper.qml | 7 +++++++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'modules/notifications') diff --git a/modules/notifications/Content.qml b/modules/notifications/Content.qml index 108f8d3..701e245 100644 --- a/modules/notifications/Content.qml +++ b/modules/notifications/Content.qml @@ -8,6 +8,8 @@ import QtQuick Item { id: root + required property PersistentProperties visibilities + required property Item panel readonly property int padding: Appearance.padding.large anchors.top: parent.top @@ -24,9 +26,6 @@ Item { for (let i = 0; i < count; i++) height += list.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 - Config.border.rounding * 2; @@ -41,7 +40,7 @@ Item { } } - return Math.min((screen?.height ?? 0) - Config.border.thickness * 2, height + padding * 2); + return Math.min((QsWindow.window?.screen?.height ?? 0) - Config.border.thickness * 2, height + padding * 2); } ClippingWrapperRectangle { diff --git a/modules/notifications/Wrapper.qml b/modules/notifications/Wrapper.qml index 27b9219..12dedcf 100644 --- a/modules/notifications/Wrapper.qml +++ b/modules/notifications/Wrapper.qml @@ -1,14 +1,21 @@ import "root:/config" +import Quickshell import QtQuick Item { id: root + required property PersistentProperties visibilities + required property Item panel + visible: height > 0 implicitHeight: content.implicitHeight implicitWidth: content.implicitWidth Content { id: content + + visibilities: root.visibilities + panel: root.panel } } -- cgit v1.2.3-freya