diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-23 16:50:12 +0800 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-23 16:50:12 +0800 |
| commit | 36f28f7c42957cd8728bf4fb7740be28d5b746cb (patch) | |
| tree | d9e96075b456244d08ad2669fe5da1aba04e3a95 /modules/bar/Bar.qml | |
| parent | dashboard: shrink bongo cat so no overlap (diff) | |
| download | caelestia-shell-36f28f7c42957cd8728bf4fb7740be28d5b746cb.tar.gz caelestia-shell-36f28f7c42957cd8728bf4fb7740be28d5b746cb.tar.bz2 caelestia-shell-36f28f7c42957cd8728bf4fb7740be28d5b746cb.zip | |
bar: switch to embedded style
Diffstat (limited to 'modules/bar/Bar.qml')
| -rw-r--r-- | modules/bar/Bar.qml | 113 |
1 files changed, 4 insertions, 109 deletions
diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 1fef083..3e749f7 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -14,121 +14,16 @@ Variants { screen: modelData name: "bar" - exclusiveZone: BarConfig.sizes.exclusiveZone - implicitWidth: BarConfig.vertical ? BarConfig.sizes.totalHeight : -1 - implicitHeight: BarConfig.vertical ? -1 : BarConfig.sizes.totalHeight + implicitWidth: content.implicitWidth anchors.top: true + anchors.bottom: true anchors.left: true - Component.onCompleted: { - if (BarConfig.vertical) - win.anchors.bottom = true; - else - win.anchors.right = true; - } - - Connections { - target: BarConfig - - function onVerticalChanged(): void { - win.visible = false; - if (BarConfig.vertical) { - win.anchors.right = false; - win.anchors.bottom = true; - } else { - win.anchors.bottom = false; - win.anchors.right = true; - } - win.visible = true; - } - } - - Item { + Content { id: content - anchors.fill: parent - - Preset { - presetName: "pills" - sourceComponent: Pills { - screen: win.modelData - } - } - - Preset { - presetName: "panel" - sourceComponent: Panel { - screen: win.modelData - } - } - } - - LayerShadow { - source: content - } - } - - component Preset: Loader { - id: loader - - required property string presetName - - anchors.fill: parent - asynchronous: true - active: false - opacity: 0 - - states: State { - name: "visible" - when: BarConfig.preset.name === loader.presetName - - PropertyChanges { - loader.opacity: 1 - loader.active: true - } - } - - transitions: [ - Transition { - from: "" - to: "visible" - - SequentialAnimation { - PropertyAction {} - NumberAnimation { - property: "opacity" - duration: Appearance.anim.durations.large - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } - } - }, - Transition { - from: "visible" - to: "" - - SequentialAnimation { - NumberAnimation { - property: "opacity" - duration: Appearance.anim.durations.large - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } - PropertyAction {} - } - } - ] - - Connections { - target: BarConfig - - function onVerticalChanged(): void { - if (loader.state === "visible") { - loader.active = false; - loader.active = true; - } - } + screen: win.modelData } } } |