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 | |
| 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')
| -rw-r--r-- | modules/bar/ActiveWindow.qml | 10 | ||||
| -rw-r--r-- | modules/bar/Bar.qml | 41 | ||||
| -rw-r--r-- | modules/bar/Clock.qml | 6 | ||||
| -rw-r--r-- | modules/bar/OsIcon.qml | 14 | ||||
| -rw-r--r-- | modules/bar/Workspaces.qml | 66 |
5 files changed, 109 insertions, 28 deletions
diff --git a/modules/bar/ActiveWindow.qml b/modules/bar/ActiveWindow.qml index f65a83f..f351534 100644 --- a/modules/bar/ActiveWindow.qml +++ b/modules/bar/ActiveWindow.qml @@ -5,17 +5,19 @@ import "root:/config" import QtQuick import QtQuick.Layouts -Box { +ClippingBoxLayout { id: root - property color colour: Appearance.colours.pink + readonly property color colour: Appearance.colours.pink + + animated: true MaterialIcon { Layout.alignment: Qt.AlignCenter - text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass) ?? "desktop_windows" + text: Icons.getAppCategoryIcon(Hyprland.activeClient?.class) ?? "desktop_windows" color: root.colour } - Text { + Label { Layout.alignment: Qt.AlignCenter text: Hyprland.activeClient?.title ?? "Desktop" diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 5aa18f7..6e18f50 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -2,6 +2,7 @@ import "root:/widgets" import "root:/config" import Quickshell import Quickshell.Wayland +import QtQuick Variants { model: Quickshell.screens @@ -9,12 +10,13 @@ Variants { WlrLayershell { id: win - property var modelData - property bool vertical: false + required property ShellScreen modelData + readonly property bool vertical: BarConfig.vertical screen: modelData namespace: "caelestia-bar" - color: Appearance.alpha(Appearance.colours.base, false) + // color: Appearance.alpha(Appearance.colours.base, false) + color: "transparent" anchors { top: true @@ -23,25 +25,34 @@ Variants { bottom: vertical } - width: contents.implicitWidth + (vertical ? Appearance.padding.normal * 2 : 0) - height: contents.implicitHeight + (vertical ? 0 : Appearance.padding.smaller * 2) + width: contents.implicitWidth + height: contents.implicitHeight Box { id: contents - vertical: win.vertical - spacing: Appearance.spacing.larger - x: Appearance.padding.normal - y: vertical ? Appearance.padding.normal : Appearance.padding.smaller + padding: [Appearance.padding.normal, Appearance.padding.large, 0, Appearance.padding.large] - OsIcon {} - - Clock { + BoxLayout { vertical: win.vertical - } + spacing: Appearance.spacing.larger + padding: [Appearance.padding.smaller, Appearance.padding.large] + color: Appearance.alpha(Appearance.colours.base, false) + radius: Appearance.rounding.small - ActiveWindow { - vertical: win.vertical + OsIcon {} + + Clock { + vertical: win.vertical + } + + ActiveWindow { + vertical: win.vertical + } + + // Workspaces { + // vertical: win.vertical + // } } } } diff --git a/modules/bar/Clock.qml b/modules/bar/Clock.qml index 4c743a6..2332f29 100644 --- a/modules/bar/Clock.qml +++ b/modules/bar/Clock.qml @@ -4,9 +4,9 @@ import "root:/config" import QtQuick import QtQuick.Layouts -Box { +BoxLayout { id: root - property color colour: Appearance.colours.peach + readonly property color colour: Appearance.colours.peach MaterialIcon { Layout.alignment: Qt.AlignCenter @@ -14,7 +14,7 @@ Box { color: root.colour } - Text { + Label { Layout.alignment: Qt.AlignCenter horizontalAlignment: Text.AlignJustify diff --git a/modules/bar/OsIcon.qml b/modules/bar/OsIcon.qml index 1737814..62ff5e6 100644 --- a/modules/bar/OsIcon.qml +++ b/modules/bar/OsIcon.qml @@ -5,11 +5,13 @@ import "root:/config" import QtQuick import QtQuick.Layouts -Text { - Layout.alignment: Qt.AlignCenter +Box { + Label { + Layout.alignment: Qt.AlignCenter - text: Icons.osIcon - font.pointSize: Appearance.font.size.smaller - font.family: Appearance.font.family.mono - color: Appearance.colours.yellow + text: Icons.osIcon + font.pointSize: Appearance.font.size.smaller + font.family: Appearance.font.family.mono + color: Appearance.colours.yellow + } } 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); + // } + // ` + // } + } +} |