bar: optional active ws indicator
This commit is contained in:
parent
bb09f65d50
commit
582fd49a69
4 changed files with 17 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue