summaryrefslogtreecommitdiff
path: root/modules/bar/components/workspaces/ActiveIndicator.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-24 15:46:15 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-24 15:46:15 +1000
commit92efbc61f72923304b92057d16760cd4d29dc67f (patch)
tree0f12ffe26475bfb50019708d2eeb533d045d8289 /modules/bar/components/workspaces/ActiveIndicator.qml
parenthypr: proper kb layout code (diff)
downloadcaelestia-shell-92efbc61f72923304b92057d16760cd4d29dc67f.tar.gz
caelestia-shell-92efbc61f72923304b92057d16760cd4d29dc67f.tar.bz2
caelestia-shell-92efbc61f72923304b92057d16760cd4d29dc67f.zip
bar: better handling for named workspaces
Fixes #448
Diffstat (limited to 'modules/bar/components/workspaces/ActiveIndicator.qml')
-rw-r--r--modules/bar/components/workspaces/ActiveIndicator.qml7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml
index 99d6275..fe5a3d0 100644
--- a/modules/bar/components/workspaces/ActiveIndicator.qml
+++ b/modules/bar/components/workspaces/ActiveIndicator.qml
@@ -11,7 +11,12 @@ StyledRect {
required property Repeater workspaces
required property Item mask
- readonly property int currentWsIdx: (activeWsId - 1) % Config.bar.workspaces.shown
+ readonly property int currentWsIdx: {
+ let i = activeWsId - 1;
+ while (i < 0)
+ i += Config.bar.workspaces.shown;
+ return i % Config.bar.workspaces.shown;
+ }
property real leading: workspaces.itemAt(currentWsIdx)?.y ?? 0
property real trailing: workspaces.itemAt(currentWsIdx)?.y ?? 0