50 lines
1.2 KiB
QML
50 lines
1.2 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
|
|
|
|
Row { // Workspace Row
|
|
id: workspacesRow
|
|
|
|
required property HyprlandMonitor thisMonitor
|
|
spacing: 8
|
|
|
|
Repeater { // repeats workspaces
|
|
model: Hyprland.workspaces
|
|
|
|
Rectangle { //workspace
|
|
visible: modelData.monitor === thisMonitor
|
|
width: workspaceNum.width + 16
|
|
height: workspaceNum.height + 8
|
|
radius: 4
|
|
color: modelData.active ? "#4a93ff": "#333333"
|
|
border.color: "#555555"
|
|
border.width: 2
|
|
|
|
MouseArea {
|
|
hoverEnabled: true
|
|
cursorShape: Qt.PointingHandCursor
|
|
anchors.fill: parent
|
|
onClicked: Hyprland.dispatch("workspace " + modelData.id)
|
|
}
|
|
|
|
Text {
|
|
id: workspaceNum
|
|
text: modelData.id
|
|
anchors.centerIn: parent
|
|
color: modelData.active ? "#ffffff" : "#cccccc"
|
|
font.pixelSize: 18
|
|
font.family: "Inter, sans-serif"
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
Text {
|
|
visible: Hyprland.workspaces.length === 0
|
|
text: "No Workspaces"
|
|
color: "#ffffff"
|
|
font.pixelSize: 18
|
|
}
|
|
}
|