diff options
Diffstat (limited to 'modules/bar/components/workspaces/Workspaces.qml')
| -rw-r--r-- | modules/bar/components/workspaces/Workspaces.qml | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index fbee318..51ae3da 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -8,15 +8,13 @@ Item { property alias vertical: layout.vertical readonly property color colour: Appearance.colours.mauve - property int shown: 10 - property bool occupiedBg: false - property bool showWindows: false readonly property list<Workspace> workspaces: layout.children.filter(c => c.isWorkspace) readonly property var occupied: Hyprland.workspaces.values.reduce((acc, curr) => { acc[curr.id] = curr.lastIpcObject.windows > 0; return acc; }, {}) + readonly property int groupOffset: Math.floor(((Hyprland.activeWorkspace?.id ?? 1) - 1) / BarConfig.workspaces.shown) * BarConfig.workspaces.shown implicitWidth: layout.implicitWidth implicitHeight: layout.implicitHeight @@ -24,7 +22,6 @@ Item { BoxLayout { id: layout - anchors.fill: parent homogenous: true spacing: 0 @@ -33,25 +30,18 @@ Item { Workspace { vertical: root.vertical - homogenous: true + homogenous: layout.homogenous occupied: root.occupied + groupOffset: root.groupOffset } } } OccupiedBg { - opacity: BarConfig.workspaces.occupiedBg ? 1 : 0 vertical: root.vertical workspaces: root.workspaces occupied: root.occupied - - Behavior on opacity { - NumberAnimation { - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard - } - } + groupOffset: root.groupOffset } ActiveIndicator { @@ -60,12 +50,13 @@ Item { mask: layout maskWidth: root.width maskHeight: root.height + groupOffset: root.groupOffset } MouseArea { anchors.fill: parent - onPressed: event => Hyprland.dispatch(`workspace ${layout.childAt(event.x, event.y).index + 1}`) + onPressed: event => Hyprland.dispatch(`workspace ${layout.childAt(event.x, event.y).index + root.groupOffset + 1}`) onWheel: event => { if (event.angleDelta.y < 0) Hyprland.dispatch(`workspace r+1`); |