bar: optional active ws indicator

This commit is contained in:
2 * r + 2 * t 2025-05-01 20:01:43 +10:00
parent bb09f65d50
commit 582fd49a69
4 changed files with 17 additions and 12 deletions

View file

@ -28,6 +28,7 @@ Singleton {
component Workspaces: QtObject {
property int shown: root.vertical ? 5 : 10
property bool rounded: true
property bool activeIndicator: true
property bool occupiedBg: false
property bool showWindows: true
property bool activeTrail: !showWindows // Doesn't work well with variable sized workspaces

View file

@ -28,9 +28,6 @@ Rectangle {
height: (vertical ? size : BarConfig.sizes.innerHeight) - 2
radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0
anchors.horizontalCenter: vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: vertical ? undefined : parent.verticalCenter
Rectangle {
id: base

View file

@ -34,7 +34,7 @@ Item {
animate: true
text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label
color: BarConfig.workspaces.occupiedBg || root.isOccupied ? Appearance.colours.m3onSurface : Appearance.colours.m3outlineVariant
color: BarConfig.workspaces.occupiedBg || root.isOccupied || Hyprland.activeWsId === root.ws ? Appearance.colours.m3onSurface : Appearance.colours.m3outlineVariant
horizontalAlignment: StyledText.AlignHCenter
verticalAlignment: StyledText.AlignVCenter

View file

@ -1,3 +1,5 @@
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/config"
@ -50,14 +52,19 @@ Item {
}
}
ActiveIndicator {
color: root.colour
vertical: root.vertical
workspaces: root.workspaces
mask: layout
maskWidth: root.width
maskHeight: root.height
groupOffset: root.groupOffset
Loader {
active: BarConfig.workspaces.activeIndicator
asynchronous: true
sourceComponent: ActiveIndicator {
color: root.colour
vertical: root.vertical
workspaces: root.workspaces
mask: layout
maskWidth: root.width
maskHeight: root.height
groupOffset: root.groupOffset
}
}
MouseArea {