From 4013fe84343b15cefdec9590b5a032d67b1a6b1a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 29 Apr 2025 12:52:01 +1000 Subject: feat: bar workspace groups --- modules/bar/components/workspaces/OccupiedBg.qml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'modules/bar/components/workspaces/OccupiedBg.qml') diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml index 7d32d4b..9ff6df9 100644 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ b/modules/bar/components/workspaces/OccupiedBg.qml @@ -1,3 +1,5 @@ +pragma ComponentBehavior: Bound + import "root:/widgets" import "root:/config" import QtQuick @@ -9,8 +11,10 @@ BoxLayout { required property bool vertical required property list workspaces required property var occupied + required property int groupOffset anchors.centerIn: parent + opacity: BarConfig.workspaces.occupiedBg ? 1 : 0 spacing: 0 z: -1 @@ -19,11 +23,13 @@ BoxLayout { Rectangle { required property int index - readonly property int roundLeft: index === 0 || !root.occupied[index] ? Appearance.rounding.full : 0 - readonly property int roundRight: index === BarConfig.workspaces.shown - 1 || !root.occupied[index + 2] ? Appearance.rounding.full : 0 + readonly property int roundLeft: index === 0 || !root.occupied[ws - 1] ? Appearance.rounding.full : 0 + readonly property int roundRight: index === BarConfig.workspaces.shown - 1 || !root.occupied[ws + 1] ? Appearance.rounding.full : 0 + + property int ws: root.groupOffset + index + 1 color: Appearance.alpha(Appearance.colours.surface2, true) - opacity: root.occupied[index + 1] ? 1 : 0 + opacity: root.occupied[ws] ? 1 : 0 topLeftRadius: roundLeft bottomLeftRadius: roundLeft topRightRadius: roundRight @@ -42,4 +48,12 @@ BoxLayout { } } } + + Behavior on opacity { + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } } -- cgit v1.2.3-freya