diff options
| author | anders130 <93037023+anders130@users.noreply.github.com> | 2025-08-13 06:53:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-13 14:53:40 +1000 |
| commit | 775410393e2b27214f3b9711ee177aff06e03d84 (patch) | |
| tree | 5a76c85354542f17671a6335bce6da337b5b77d8 /modules/bar/components/workspaces/Workspaces.qml | |
| parent | bar: allow hiding items and reordering (#379) (diff) | |
| download | caelestia-shell-775410393e2b27214f3b9711ee177aff06e03d84.tar.gz caelestia-shell-775410393e2b27214f3b9711ee177aff06e03d84.tar.bz2 caelestia-shell-775410393e2b27214f3b9711ee177aff06e03d84.zip | |
bar: per-monitor workspaces option (#394)
NOTE: option is true by default, which is a breaking change
* feat(bar): add per-monitor workspace state
* fix(bar): correct active workspace indicator
* feat(bar): make per-monitor workspaces toggleable
* fixes
* more fixes
* perMonitorWorkspaces default true + add to readme
---------
Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Diffstat (limited to 'modules/bar/components/workspaces/Workspaces.qml')
| -rw-r--r-- | modules/bar/components/workspaces/Workspaces.qml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index fb6201d..68e9ac1 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -3,18 +3,22 @@ pragma ComponentBehavior: Bound import qs.services import qs.config import qs.components +import Quickshell import QtQuick import QtQuick.Layouts StyledRect { id: root + required property ShellScreen screen + + readonly property int activeWsId: Config.bar.workspaces.perMonitorWorkspaces ? (Hyprland.monitorFor(screen).activeWorkspace?.id ?? 1) : Hyprland.activeWsId readonly property list<Workspace> workspaces: layout.children.filter(c => c.isWorkspace).sort((w1, w2) => w1.ws - w2.ws) 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.activeWsId - 1) / Config.bar.workspaces.shown) * Config.bar.workspaces.shown + readonly property int groupOffset: Math.floor((activeWsId - 1) / Config.bar.workspaces.shown) * Config.bar.workspaces.shown implicitWidth: layout.implicitWidth + Appearance.padding.small * 2 implicitHeight: layout.implicitHeight + Appearance.padding.small * 2 @@ -31,13 +35,12 @@ StyledRect { id: layout spacing: 0 - layer.enabled: true - layer.smooth: true Repeater { model: Config.bar.workspaces.shown Workspace { + activeWsId: root.activeWsId occupied: root.occupied groupOffset: root.groupOffset } @@ -63,6 +66,7 @@ StyledRect { asynchronous: true sourceComponent: ActiveIndicator { + activeWsId: root.activeWsId workspaces: root.workspaces mask: layout maskWidth: inner.width |