diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-12 16:58:43 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-12 16:58:43 +1000 |
| commit | 53f7da32e4067940494576b675596a11bf1af723 (patch) | |
| tree | 518f921287622b766a57ba048963e9990168bc4d /modules | |
| parent | utilities: add keep awake and quick toggles (diff) | |
| download | caelestia-shell-53f7da32e4067940494576b675596a11bf1af723.tar.gz caelestia-shell-53f7da32e4067940494576b675596a11bf1af723.tar.bz2 caelestia-shell-53f7da32e4067940494576b675596a11bf1af723.zip | |
utilities: loader content
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/utilities/Wrapper.qml | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/modules/utilities/Wrapper.qml b/modules/utilities/Wrapper.qml index a5637a4..830ee5a 100644 --- a/modules/utilities/Wrapper.qml +++ b/modules/utilities/Wrapper.qml @@ -1,3 +1,5 @@ +pragma ComponentBehavior: Bound + import qs.components import qs.config import QtQuick @@ -11,6 +13,13 @@ Item { implicitHeight: 0 implicitWidth: Config.utilities.sizes.width + onStateChanged: { + if (state === "visible" && timer.running) { + timer.triggered(); + timer.stop(); + } + } + states: State { name: "visible" when: root.visibilities.utilities @@ -44,7 +53,18 @@ Item { } ] - Content { + Timer { + id: timer + + running: true + interval: Appearance.anim.durations.extraLarge + onTriggered: { + content.active = Qt.binding(() => (root.visibilities.utilities && Config.utilities.enabled) || root.visible); + content.visible = true; + } + } + + Loader { id: content anchors.top: parent.top @@ -52,6 +72,11 @@ Item { anchors.right: parent.right anchors.margins: Appearance.padding.large - visibilities: root.visibilities + visible: false + active: true + + sourceComponent: Content { + visibilities: root.visibilities + } } } |