summaryrefslogtreecommitdiff
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
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
-rw-r--r--config/BarConfig.qml4
-rw-r--r--modules/bar/Bar.qml2
-rw-r--r--modules/bar/BarWrapper.qml78
-rw-r--r--modules/drawers/Drawers.qml6
-rw-r--r--modules/drawers/Exclusions.qml2
-rw-r--r--modules/drawers/Interactions.qml20
6 files changed, 109 insertions, 3 deletions
diff --git a/config/BarConfig.qml b/config/BarConfig.qml
index 31577c4..bfca030 100644
--- a/config/BarConfig.qml
+++ b/config/BarConfig.qml
@@ -1,6 +1,10 @@
import Quickshell.Io
JsonObject {
+ property bool persistent: true
+ property bool showOnHover: true
+ property int dragThreshold: 20
+
property JsonObject sizes: JsonObject {
property int innerHeight: 30
property int windowPreviewSize: 400
diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml
index 13eb7ba..39b9624 100644
--- a/modules/bar/Bar.qml
+++ b/modules/bar/Bar.qml
@@ -1,7 +1,7 @@
import "root:/widgets"
import "root:/services"
import "root:/config"
-import "root:/modules/bar/popouts" as BarPopouts
+import "popouts" as BarPopouts
import "components"
import "components/workspaces"
import Quickshell
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
+ }
+ }
+}
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
index 72d8446..6a4777a 100644
--- a/modules/drawers/Drawers.qml
+++ b/modules/drawers/Drawers.qml
@@ -107,6 +107,7 @@ Variants {
PersistentProperties {
id: visibilities
+ property bool bar
property bool osd
property bool session
property bool launcher
@@ -132,9 +133,12 @@ Variants {
}
}
- Bar {
+ BarWrapper {
id: bar
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+
screen: scope.modelData
visibilities: visibilities
popouts: panels.popouts
diff --git a/modules/drawers/Exclusions.qml b/modules/drawers/Exclusions.qml
index 5557cdb..390ad68 100644
--- a/modules/drawers/Exclusions.qml
+++ b/modules/drawers/Exclusions.qml
@@ -13,7 +13,7 @@ Scope {
ExclusionZone {
anchors.left: true
- exclusiveZone: root.bar.implicitWidth
+ exclusiveZone: root.bar.exclusiveZone
}
ExclusionZone {
diff --git a/modules/drawers/Interactions.qml b/modules/drawers/Interactions.qml
index 0a00219..9c9aeb3 100644
--- a/modules/drawers/Interactions.qml
+++ b/modules/drawers/Interactions.qml
@@ -60,6 +60,9 @@ MouseArea {
visibilities.utilities = false;
}
popouts.hasCurrent = false;
+
+ if (bar.isHovered && Config.bar.showOnHover)
+ visibilities.bar = false;
}
}
@@ -67,6 +70,23 @@ MouseArea {
const x = event.x;
const y = event.y;
+ // Show bar in non-exclusive mode on hover
+ if (!visibilities.bar && Config.bar.showOnHover && x < bar.implicitWidth) {
+ visibilities.bar = true;
+ bar.isHovered = true;
+ }
+
+ // Show/hide bar on drag
+ if (pressed && dragStart.x < bar.implicitWidth) {
+ const dragX = x - dragStart.x;
+ if (dragX > Config.bar.dragThreshold) {
+ visibilities.bar = true;
+ bar.isHovered = false;
+ } else if (!bar.isHovered && dragX < -Config.bar.dragThreshold) {
+ visibilities.bar = false;
+ }
+ }
+
// Show osd on hover
const showOsd = inRightPanel(panels.osd, x, y);