From ad7c6ea98e4588172398669bb8b7939999c7f121 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 13 May 2025 16:30:53 +1000 Subject: refactor: move to single window --- modules/osd/Wrapper.qml | 56 ++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) (limited to 'modules/osd/Wrapper.qml') diff --git a/modules/osd/Wrapper.qml b/modules/osd/Wrapper.qml index 6c21c1a..e56fa2b 100644 --- a/modules/osd/Wrapper.qml +++ b/modules/osd/Wrapper.qml @@ -1,23 +1,23 @@ +import "root:/services" import "root:/config" +import Quickshell import QtQuick Item { id: root - required property bool osdVisible - required property real contentWidth - property bool shouldBeVisible + required property ShellScreen screen visible: width > 0 - width: 0 + implicitWidth: 0 + implicitHeight: content.height + BorderConfig.rounding * 2 states: State { name: "visible" - when: root.osdVisible + when: Drawers.visibilities[root.screen].osd PropertyChanges { - root.width: contentWidth - root.shouldBeVisible: true + root.implicitWidth: content.width } } @@ -26,37 +26,31 @@ Item { from: "" to: "visible" - SequentialAnimation { - PropertyAction { - target: root - property: "shouldBeVisible" - } - NumberAnimation { - target: root - property: "width" - duration: Appearance.anim.durations.large - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.emphasizedDecel - } + NumberAnimation { + target: root + property: "implicitWidth" + duration: Appearance.anim.durations.large + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasizedDecel } }, Transition { from: "visible" to: "" - SequentialAnimation { - NumberAnimation { - target: root - property: "width" - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.emphasizedAccel - } - PropertyAction { - target: root - property: "shouldBeVisible" - } + NumberAnimation { + target: root + property: "implicitWidth" + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasizedAccel } } ] + + Content { + id: content + + monitor: Brightness.getMonitorForScreen(root.screen) + } } -- cgit v1.2.3-freya