diff options
Diffstat (limited to 'modules/bar/components/workspaces')
| -rw-r--r-- | modules/bar/components/workspaces/ActiveIndicator.qml | 16 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/OccupiedBg.qml | 6 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspace.qml | 16 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspaces.qml | 8 |
4 files changed, 23 insertions, 23 deletions
diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml index 3f3ca62..6807397 100644 --- a/modules/bar/components/workspaces/ActiveIndicator.qml +++ b/modules/bar/components/workspaces/ActiveIndicator.qml @@ -20,7 +20,7 @@ StyledRect { property real offset: Math.min(leading, trailing) property real size: { const s = Math.abs(leading - trailing) + currentSize; - if (BarConfig.workspaces.activeTrail && lastWs > currentWsIdx) + if (Config.bar.workspaces.activeTrail && lastWs > currentWsIdx) return Math.min(getWsY(lastWs) + (workspaces[lastWs]?.size ?? 0) - offset, s); return s; } @@ -43,9 +43,9 @@ StyledRect { clip: true x: 1 y: offset + 1 - implicitWidth: BarConfig.sizes.innerHeight - 2 + implicitWidth: Config.bar.sizes.innerHeight - 2 implicitHeight: size - 2 - radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0 + radius: Config.bar.workspaces.rounded ? Appearance.rounding.full : 0 color: Colours.palette.m3primary StyledRect { @@ -72,13 +72,13 @@ StyledRect { } Behavior on leading { - enabled: BarConfig.workspaces.activeTrail + enabled: Config.bar.workspaces.activeTrail Anim {} } Behavior on trailing { - enabled: BarConfig.workspaces.activeTrail + enabled: Config.bar.workspaces.activeTrail Anim { duration: Appearance.anim.durations.normal * 2 @@ -86,19 +86,19 @@ StyledRect { } Behavior on currentSize { - enabled: BarConfig.workspaces.activeTrail + enabled: Config.bar.workspaces.activeTrail Anim {} } Behavior on offset { - enabled: !BarConfig.workspaces.activeTrail + enabled: !Config.bar.workspaces.activeTrail Anim {} } Behavior on size { - enabled: !BarConfig.workspaces.activeTrail + enabled: !Config.bar.workspaces.activeTrail Anim {} } diff --git a/modules/bar/components/workspaces/OccupiedBg.qml b/modules/bar/components/workspaces/OccupiedBg.qml index 4fba2f4..c5ed7cc 100644 --- a/modules/bar/components/workspaces/OccupiedBg.qml +++ b/modules/bar/components/workspaces/OccupiedBg.qml @@ -18,7 +18,7 @@ Item { onOccupiedChanged: { let count = 0; const start = groupOffset; - const end = start + BarConfig.workspaces.shown; + const end = start + Config.bar.workspaces.shown; for (const [ws, occ] of Object.entries(occupied)) { if (ws > start && ws <= end && occ) { if (!occupied[ws - 1]) { @@ -52,11 +52,11 @@ Item { readonly property Workspace end: root.workspaces[modelData.end - 1 - root.groupOffset] ?? null color: Colours.alpha(Colours.palette.m3surfaceContainerHigh, true) - radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0 + radius: Config.bar.workspaces.rounded ? Appearance.rounding.full : 0 x: start?.x ?? 0 y: start?.y ?? 0 - implicitWidth: BarConfig.sizes.innerHeight + implicitWidth: Config.bar.sizes.innerHeight implicitHeight: end?.y + end?.height - start?.y anchors.horizontalCenter: parent.horizontalCenter diff --git a/modules/bar/components/workspaces/Workspace.qml b/modules/bar/components/workspaces/Workspace.qml index fa5fe62..6cf5c40 100644 --- a/modules/bar/components/workspaces/Workspace.qml +++ b/modules/bar/components/workspaces/Workspace.qml @@ -19,7 +19,7 @@ Item { readonly property int ws: groupOffset + index + 1 readonly property bool isOccupied: occupied[ws] ?? false - readonly property bool hasWindows: isOccupied && BarConfig.workspaces.showWindows + readonly property bool hasWindows: isOccupied && Config.bar.workspaces.showWindows Layout.preferredWidth: childrenRect.width Layout.preferredHeight: size @@ -27,24 +27,24 @@ Item { StyledText { id: indicator - readonly property string label: BarConfig.workspaces.label || root.ws - readonly property string occupiedLabel: BarConfig.workspaces.occupiedLabel || label - readonly property string activeLabel: BarConfig.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label) + readonly property string label: Config.bar.workspaces.label || root.ws + readonly property string occupiedLabel: Config.bar.workspaces.occupiedLabel || label + readonly property string activeLabel: Config.bar.workspaces.activeLabel || (root.isOccupied ? occupiedLabel : label) animate: true text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label - color: BarConfig.workspaces.occupiedBg || root.isOccupied || Hyprland.activeWsId === root.ws ? Colours.palette.m3onSurface : Colours.palette.m3outlineVariant + color: Config.bar.workspaces.occupiedBg || root.isOccupied || Hyprland.activeWsId === root.ws ? Colours.palette.m3onSurface : Colours.palette.m3outlineVariant horizontalAlignment: StyledText.AlignHCenter verticalAlignment: StyledText.AlignVCenter - width: BarConfig.sizes.innerHeight - height: BarConfig.sizes.innerHeight + width: Config.bar.sizes.innerHeight + height: Config.bar.sizes.innerHeight } Loader { id: windows - active: BarConfig.workspaces.showWindows + active: Config.bar.workspaces.showWindows asynchronous: true anchors.horizontalCenter: indicator.horizontalCenter diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index 4f4c75b..9264762 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -14,7 +14,7 @@ Item { acc[curr.id] = curr.lastIpcObject.windows > 0; return acc; }, {}) - readonly property int groupOffset: Math.floor((Hyprland.activeWsId - 1) / BarConfig.workspaces.shown) * BarConfig.workspaces.shown + readonly property int groupOffset: Math.floor((Hyprland.activeWsId - 1) / Config.bar.workspaces.shown) * Config.bar.workspaces.shown implicitWidth: layout.implicitWidth implicitHeight: layout.implicitHeight @@ -27,7 +27,7 @@ Item { layer.smooth: true Repeater { - model: BarConfig.workspaces.shown + model: Config.bar.workspaces.shown Workspace { occupied: root.occupied @@ -37,7 +37,7 @@ Item { } Loader { - active: BarConfig.workspaces.occupiedBg + active: Config.bar.workspaces.occupiedBg asynchronous: true z: -1 @@ -51,7 +51,7 @@ Item { } Loader { - active: BarConfig.workspaces.activeIndicator + active: Config.bar.workspaces.activeIndicator asynchronous: true sourceComponent: ActiveIndicator { |