make ws clickable
This commit is contained in:
parent
91143bea91
commit
ffd60a616a
2 changed files with 21 additions and 9 deletions
|
|
@ -15,27 +15,39 @@ Rectangle {
|
|||
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
|
||||
radius: Config.rounding
|
||||
color: Colors.base01
|
||||
implicitWidth: wsLayout.implicitWidth + 32
|
||||
implicitWidth: wsLayout.implicitWidth
|
||||
implicitHeight: moduleHeight
|
||||
|
||||
RowLayout {
|
||||
id: wsLayout
|
||||
anchors.centerIn: parent
|
||||
anchors.centerIn: root
|
||||
anchors.fill: root
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: 8
|
||||
spacing: 0
|
||||
Repeater {
|
||||
id: wsRepeater
|
||||
model: Hyprland.workspaces
|
||||
delegate: WrapperRectangle {
|
||||
delegate: Rectangle {
|
||||
id: wsWrapper
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitHeight: root.moduleHeight - 4
|
||||
implicitWidth: modelData.active ? 48 : 32
|
||||
parent: wsLayout
|
||||
color: 'transparent'
|
||||
color: modelData.active ? Colors.base0D : Colors.base01
|
||||
radius: Config.rounding
|
||||
visible: modelData.monitor == root.hyprBarScreen
|
||||
required property var modelData
|
||||
child: StyledText {
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: wsWrapper.modelData.id
|
||||
opacity: wsWrapper.modelData.active ? 1.0 : 0.6
|
||||
color: parent.modelData.active ? Colors.base00 : Colors.base07
|
||||
}
|
||||
MouseArea {
|
||||
id: clickHandler
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: parent.modelData.activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue