Files
dotfiles/quickshell/Workspaces.qml
2025-07-23 19:17:11 +01:00

43 lines
1.2 KiB
QML

import Quickshell
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
import Quickshell.Widgets
import Quickshell.Hyprland
RowLayout {
id: root
spacing: 3
Repeater {
model: Hyprland.workspaces
delegate: Item {
required property int index
property HyprlandWorkspace index_workspace: Hyprland.workspaces.values[index]
width: 25
height: 30
MouseArea {
Rectangle {
id: reg
anchors.fill: parent
color: index_workspace.focused ? "#3B3B3B" : "#808080"
}
Layout.fillWidth: true
Text {
anchors.centerIn: parent
text: index_workspace.id
color: "#FFFFFF"
font.pointSize: 10.75
}
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onPressed: event => {
if (event.button === Qt.LeftButton) {
Hyprland.dispatch('workspace ' + index_workspace.id);
}
}
}
}
}
}