44 lines
1.1 KiB
QML
44 lines
1.1 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
import "../core"
|
|
|
|
RowLayout {
|
|
id: root
|
|
spacing: 4
|
|
|
|
property var monitor: null
|
|
|
|
Repeater {
|
|
model: Hyprland.workspaces
|
|
|
|
delegate: Rectangle {
|
|
property var ws: modelData
|
|
|
|
// Only show workspaces belonging to the specific monitor
|
|
visible: root.monitor === null || (ws.monitor && ws.monitor.name === root.monitor.name)
|
|
|
|
width: visible ? 28 : 0
|
|
height: visible ? 28 : 0
|
|
radius: Theme.radius / 2
|
|
|
|
// Highlight if active
|
|
color: ws.isActive ? Theme.primary : Theme.bgAlt
|
|
|
|
Text {
|
|
anchors.centerIn: parent
|
|
text: ws.id
|
|
color: ws.isActive ? Theme.bg : Theme.fg
|
|
font: Theme.fontBold
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
onClicked: Hyprland.dispatch("workspace", ws.id)
|
|
cursorShape: Qt.PointingHandCursor
|
|
}
|
|
}
|
|
}
|
|
}
|