From 24a3da813862623b3eec05ef5050ba715e08c684 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:31:26 +0800 Subject: feat: bar popouts Create active window popout --- modules/bar/popouts/Content.qml | 79 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 modules/bar/popouts/Content.qml (limited to 'modules/bar/popouts/Content.qml') diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml new file mode 100644 index 0000000..be45eac --- /dev/null +++ b/modules/bar/popouts/Content.qml @@ -0,0 +1,79 @@ +import "root:/services" +import "root:/config" +import Quickshell +import Quickshell.Widgets +import QtQuick + +Item { + id: root + + required property ShellScreen screen + + anchors.centerIn: parent + + implicitWidth: Popouts.hasCurrent ? content.children.find(c => c.shouldBeActive).implicitWidth + Appearance.padding.large * 2 : 0 + implicitHeight: Popouts.hasCurrent ? content.children.find(c => c.shouldBeActive).implicitHeight + Appearance.padding.large * 2 : 0 + clip: true + + Item { + id: content + + anchors.fill: parent + anchors.margins: Appearance.padding.large + + clip: true + + Popout { + name: "activewindow" + sourceComponent: ActiveWindow {} + } + } + + Behavior on implicitWidth { + Anim { + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } + + Behavior on implicitHeight { + Anim { + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } + + component Popout: Loader { + id: popout + + required property string name + property bool shouldBeActive: Popouts.currentName === name + + active: shouldBeActive + asynchronous: true + + Behavior on active { + SequentialAnimation { + Anim { + target: popout + property: "opacity" + from: popout.shouldBeActive ? 1 : 0 + to: popout.shouldBeActive ? 0 : 1 + duration: popout.shouldBeActive ? 0 : Appearance.anim.durations.normal + } + PropertyAction {} + Anim { + target: popout + property: "opacity" + from: popout.shouldBeActive ? 0 : 1 + to: popout.shouldBeActive ? 1 : 0 + duration: popout.shouldBeActive ? Appearance.anim.durations.normal : 0 + } + } + } + } + + component Anim: NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } +} -- cgit v1.2.3-freya