summaryrefslogtreecommitdiff
path: root/modules/bar/popouts
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-02 16:31:26 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-02 16:31:26 +0800
commit24a3da813862623b3eec05ef5050ba715e08c684 (patch)
tree1674c1be77e48befe6e877b421f799deca6c4475 /modules/bar/popouts
parentosd: fix text not updating during transition (diff)
downloadcaelestia-shell-24a3da813862623b3eec05ef5050ba715e08c684.tar.gz
caelestia-shell-24a3da813862623b3eec05ef5050ba715e08c684.tar.bz2
caelestia-shell-24a3da813862623b3eec05ef5050ba715e08c684.zip
feat: bar popouts
Create active window popout
Diffstat (limited to 'modules/bar/popouts')
-rw-r--r--modules/bar/popouts/ActiveWindow.qml33
-rw-r--r--modules/bar/popouts/Background.qml63
-rw-r--r--modules/bar/popouts/Content.qml79
-rw-r--r--modules/bar/popouts/Wrapper.qml19
4 files changed, 194 insertions, 0 deletions
diff --git a/modules/bar/popouts/ActiveWindow.qml b/modules/bar/popouts/ActiveWindow.qml
new file mode 100644
index 0000000..06ad52c
--- /dev/null
+++ b/modules/bar/popouts/ActiveWindow.qml
@@ -0,0 +1,33 @@
+
+
+import "root:/widgets"
+import "root:/services"
+import "root:/utils"
+import "root:/config"
+import Quickshell.Wayland
+import QtQuick
+
+Item {
+ id: root
+
+ implicitWidth: child.implicitWidth
+ implicitHeight: child.implicitHeight
+
+ Column {
+ id: child
+
+ anchors.centerIn: parent
+
+ StyledText {
+ text: Hyprland.activeClient?.title ?? ""
+ }
+
+ StyledText {
+ text: Hyprland.activeClient?.wmClass ?? ""
+ }
+
+ ScreencopyView {
+
+ }
+ }
+}
diff --git a/modules/bar/popouts/Background.qml b/modules/bar/popouts/Background.qml
new file mode 100644
index 0000000..dd76af8
--- /dev/null
+++ b/modules/bar/popouts/Background.qml
@@ -0,0 +1,63 @@
+import "root:/services"
+import "root:/config"
+import QtQuick
+import QtQuick.Shapes
+
+ShapePath {
+ id: root
+
+ required property Wrapper wrapper
+ readonly property real rounding: BorderConfig.rounding
+ readonly property bool flatten: wrapper.width < rounding * 2
+ readonly property real roundingX: flatten ? wrapper.width / 2 : rounding
+
+ strokeWidth: -1
+ fillColor: BorderConfig.colour
+
+ PathArc {
+ relativeX: root.roundingX
+ relativeY: root.rounding
+ radiusX: Math.min(root.rounding, root.wrapper.width)
+ radiusY: root.rounding
+ direction: PathArc.Counterclockwise
+ }
+ PathLine {
+ relativeX: root.wrapper.width - root.roundingX * 2
+ relativeY: 0
+ }
+ PathArc {
+ relativeX: root.roundingX
+ relativeY: root.rounding
+ radiusX: Math.min(root.rounding, root.wrapper.width)
+ radiusY: root.rounding
+ }
+ PathLine {
+ relativeX: 0
+ relativeY: root.wrapper.height - root.rounding * 4
+ }
+ PathArc {
+ relativeX: -root.roundingX
+ relativeY: root.rounding
+ radiusX: Math.min(root.rounding, root.wrapper.width)
+ radiusY: root.rounding
+ }
+ PathLine {
+ relativeX: -(root.wrapper.width - root.roundingX * 2)
+ relativeY: 0
+ }
+ PathArc {
+ relativeX: -root.roundingX
+ relativeY: root.rounding
+ radiusX: Math.min(root.rounding, root.wrapper.width)
+ radiusY: root.rounding
+ direction: PathArc.Counterclockwise
+ }
+
+ Behavior on fillColor {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+}
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
+ }
+}
diff --git a/modules/bar/popouts/Wrapper.qml b/modules/bar/popouts/Wrapper.qml
new file mode 100644
index 0000000..7782d90
--- /dev/null
+++ b/modules/bar/popouts/Wrapper.qml
@@ -0,0 +1,19 @@
+import "root:/services"
+import "root:/config"
+import Quickshell
+import QtQuick
+
+Item {
+ id: root
+
+ required property ShellScreen screen
+
+ implicitWidth: content.implicitWidth
+ implicitHeight: content.implicitHeight + BorderConfig.rounding * 2
+
+ Content {
+ id: content
+
+ screen: root.screen
+ }
+}