diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-28 00:21:53 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-28 00:21:53 +1000 |
| commit | cba440bcfced79eda2764e441c68239b6c594457 (patch) | |
| tree | 15e72a41a47015a1440a7c6b54c51d8f182ebe24 /modules/bar/Workspaces.qml | |
| parent | hyprland: use qs hyprland service (diff) | |
| download | caelestia-shell-cba440bcfced79eda2764e441c68239b6c594457.tar.gz caelestia-shell-cba440bcfced79eda2764e441c68239b6c594457.tar.bz2 caelestia-shell-cba440bcfced79eda2764e441c68239b6c594457.zip | |
feat: anims + box padding
box provide padding and animate size and colour
provide box and boxlayout for with/without layout
provide clippingbox
provide label for anim + rendertype
configure QtQuick controls
Diffstat (limited to 'modules/bar/Workspaces.qml')
| -rw-r--r-- | modules/bar/Workspaces.qml | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/modules/bar/Workspaces.qml b/modules/bar/Workspaces.qml new file mode 100644 index 0000000..73995c8 --- /dev/null +++ b/modules/bar/Workspaces.qml @@ -0,0 +1,66 @@ +pragma ComponentBehavior: Bound + +import "root:/widgets" +import "root:/services" +import "root:/config" +import Quickshell +import QtQuick +import QtQuick.Layouts + +Item { + property alias vertical: root.vertical + + implicitWidth: root.implicitWidth + implicitHeight: root.implicitHeight + + Box { + id: root + + readonly property color colour: Appearance.colours.mauve + + // homogenous: true + + Repeater { + model: BarConfig.workspaces.shown + + Label { + required property int index + + text: (index + 1).toString() + color: root.colour + } + } + + // Text { + // Layout.alignment: Qt.AlignCenter + // horizontalAlignment: Text.AlignJustify + + // text: root.vertical ? Time.format("hh\nmm") : Time.format("dd/MM/yy hh:mm") + // font.pointSize: Appearance.font.size.smaller + // font.family: Appearance.font.family.mono + // color: root.colour + // } + } + + Rectangle { + x: (root.childrenRect.width / BarConfig.workspaces.shown) * ((Hyprland.activeWorkspace?.id ?? 1) - 1) + y: 0 + width: root.childrenRect.width / BarConfig.workspaces.shown + height: root.childrenRect.height + color: "red" + radius: 1000 + + // layer.enabled: true + // layer.effect: ShaderEffect { + // readonly property Item source: root + // fragmentShader: ` + // varying highp vec2 qt_TexCoord0; + // uniform highp vec4 color; + // uniform sampler2D source; + // void main() { + // gl_FragColor = color * (1.0 - texture2D(source, qt_TexCoord0).w); + // } + // ` + // } + } +} |