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 { component Workspaces: QtObject {
property int shown: root.vertical ? 5 : 10 property int shown: root.vertical ? 5 : 10
property bool rounded: true property bool rounded: true
property bool activeIndicator: true
property bool occupiedBg: false property bool occupiedBg: false
property bool showWindows: true property bool showWindows: true
property bool activeTrail: !showWindows // Doesn't work well with variable sized workspaces 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 height: (vertical ? size : BarConfig.sizes.innerHeight) - 2
radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0 radius: BarConfig.workspaces.rounded ? Appearance.rounding.full : 0
anchors.horizontalCenter: vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: vertical ? undefined : parent.verticalCenter
Rectangle { Rectangle {
id: base id: base

View file

@ -34,7 +34,7 @@ Item {
animate: true animate: true
text: Hyprland.activeWsId === root.ws ? activeLabel : root.isOccupied ? occupiedLabel : label 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 horizontalAlignment: StyledText.AlignHCenter
verticalAlignment: StyledText.AlignVCenter verticalAlignment: StyledText.AlignVCenter

View file

@ -1,3 +1,5 @@
pragma ComponentBehavior: Bound
import "root:/widgets" import "root:/widgets"
import "root:/services" import "root:/services"
import "root:/config" import "root:/config"
@ -50,7 +52,11 @@ Item {
} }
} }
ActiveIndicator { Loader {
active: BarConfig.workspaces.activeIndicator
asynchronous: true
sourceComponent: ActiveIndicator {
color: root.colour color: root.colour
vertical: root.vertical vertical: root.vertical
workspaces: root.workspaces workspaces: root.workspaces
@ -59,6 +65,7 @@ Item {
maskHeight: root.height maskHeight: root.height
groupOffset: root.groupOffset groupOffset: root.groupOffset
} }
}
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent