diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-27 10:42:08 +0800 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-27 10:42:08 +0800 |
| commit | 63da636144635e5aa6b7ff1a2d2eec2a1e35aafa (patch) | |
| tree | cd5461058c7afedb2d17f474f13ee218759519ba /modules/bar/components/workspaces/ActiveIndicator.qml | |
| parent | drawers: dont use hyprland cursor pos (diff) | |
| download | caelestia-shell-63da636144635e5aa6b7ff1a2d2eec2a1e35aafa.tar.gz caelestia-shell-63da636144635e5aa6b7ff1a2d2eec2a1e35aafa.tar.bz2 caelestia-shell-63da636144635e5aa6b7ff1a2d2eec2a1e35aafa.zip | |
internal: bar only vertical
The bar can only be vertical
Remove box, boxlayout and anchortext
Add StyledClippingRect
Diffstat (limited to 'modules/bar/components/workspaces/ActiveIndicator.qml')
| -rw-r--r-- | modules/bar/components/workspaces/ActiveIndicator.qml | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml index 58727dd..d55bdb8 100644 --- a/modules/bar/components/workspaces/ActiveIndicator.qml +++ b/modules/bar/components/workspaces/ActiveIndicator.qml @@ -4,10 +4,9 @@ import "root:/config" import QtQuick import QtQuick.Effects -Rectangle { +StyledRect { id: root - required property bool vertical required property list<Workspace> workspaces required property Item mask required property real maskWidth @@ -15,34 +14,26 @@ Rectangle { required property int groupOffset readonly property Workspace currentWs: workspaces[Hyprland.activeWsId - 1 - groupOffset] ?? null - property real leading: (vertical ? currentWs?.y : currentWs?.x) ?? 0 - property real trailing: (vertical ? currentWs?.y : currentWs?.x) ?? 0 + property real leading: currentWs?.y ?? 0 + property real trailing: currentWs?.y ?? 0 property real currentSize: (currentWs?.size) ?? 0 property real size: Math.abs(leading - trailing) + currentSize property real offset: Math.min(leading, trailing) clip: true - x: vertical ? 1 : offset + 1 - y: vertical ? offset + 1 : 1 - implicitWidth: (vertical ? BarConfig.sizes.innerHeight : size) - 2 - implicitHeight: (vertical ? size : BarConfig.sizes.innerHeight) - 2 + x: 1 + y: offset + 1 + implicitWidth: BarConfig.sizes.innerHeight - 2 + implicitHeight: size - 2 radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0 color: Colours.palette.m3primary - Rectangle { + StyledRect { id: base visible: false anchors.fill: parent color: Colours.palette.m3onPrimary - - Behavior on color { - ColorAnimation { - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } - } } MultiEffect { @@ -52,21 +43,12 @@ Rectangle { maskSpreadAtMin: 1 maskThresholdMin: 0.5 - x: root.vertical ? 0 : -parent.offset - y: root.vertical ? -parent.offset : 0 + x: 0 + y: -parent.offset implicitWidth: root.maskWidth implicitHeight: root.maskHeight - anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined - anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter - } - - Behavior on color { - ColorAnimation { - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } + anchors.horizontalCenter: parent.horizontalCenter } Behavior on leading { |