summaryrefslogtreecommitdiff
path: root/modules/bar/BarWrapper.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-10 13:37:34 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-10 13:37:34 +1000
commit6222f969d4e641582544c90053a1fc6fc61da338 (patch)
tree56666f952e712717443b0223b81cc7275aa0acd4 /modules/bar/BarWrapper.qml
parentfeat: drag launcher to open/close (diff)
downloadcaelestia-shell-6222f969d4e641582544c90053a1fc6fc61da338.tar.gz
caelestia-shell-6222f969d4e641582544c90053a1fc6fc61da338.tar.bz2
caelestia-shell-6222f969d4e641582544c90053a1fc6fc61da338.zip
feat: non persistent bar option
Diffstat (limited to 'modules/bar/BarWrapper.qml')
-rw-r--r--modules/bar/BarWrapper.qml78
1 files changed, 78 insertions, 0 deletions
diff --git a/modules/bar/BarWrapper.qml b/modules/bar/BarWrapper.qml
new file mode 100644
index 0000000..698761d
--- /dev/null
+++ b/modules/bar/BarWrapper.qml
@@ -0,0 +1,78 @@
+pragma ComponentBehavior: Bound
+
+import "root:/services"
+import "root:/config"
+import "popouts" as BarPopouts
+import Quickshell
+import QtQuick
+
+Item {
+ id: root
+
+ required property ShellScreen screen
+ required property PersistentProperties visibilities
+ required property BarPopouts.Wrapper popouts
+
+ readonly property int exclusiveZone: Config.bar.persistent || (visibilities.bar && !isHovered) ? content.implicitWidth : Config.border.thickness
+ property bool isHovered
+
+ function checkPopout(y: real): void {
+ content.item?.checkPopout(y);
+ }
+
+ visible: width > Config.border.thickness
+ implicitWidth: Config.border.thickness
+ implicitHeight: content.implicitHeight
+
+ states: State {
+ name: "visible"
+ when: Config.bar.persistent || root.visibilities.bar
+
+ PropertyChanges {
+ root.implicitWidth: content.implicitWidth
+ }
+ }
+
+ transitions: [
+ Transition {
+ from: ""
+ to: "visible"
+
+ NumberAnimation {
+ target: root
+ property: "implicitWidth"
+ duration: Appearance.anim.durations.expressiveDefaultSpatial
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
+ }
+ },
+ Transition {
+ from: "visible"
+ to: ""
+
+ NumberAnimation {
+ target: root
+ property: "implicitWidth"
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.emphasized
+ }
+ }
+ ]
+
+ Loader {
+ id: content
+
+ Component.onCompleted: active = Qt.binding(() => root.visibilities.bar || root.visible)
+
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+
+ sourceComponent: Bar {
+ screen: root.screen
+ visibilities: root.visibilities
+ popouts: root.popouts
+ }
+ }
+}