quickshell/modules/bar/Workspaces.qml

38 lines
1.1 KiB
QML
Raw Normal View History

2025-12-21 20:59:33 +01:00
import Quickshell.Hyprland
import QtQuick
import QtQuick.Layouts
2025-12-24 15:41:03 +01:00
import qs
2025-12-21 20:59:33 +01:00
Item {
id: root
property var modelData
2025-12-21 21:24:03 +01:00
implicitWidth: workspaceRow.implicitWidth
2025-12-21 20:59:33 +01:00
height: 30
Row {
2025-12-21 21:24:03 +01:00
id: workspaceRow
2025-12-21 20:59:33 +01:00
anchors.centerIn: parent
spacing: 10 // Slightly increase spacing between workspace buttons
Repeater {
anchors.centerIn: parent
2025-12-21 20:59:33 +01:00
Rectangle {
id: workspaceNumber
2025-12-24 15:41:03 +01:00
width: 16
height: 16
radius: 20
2025-12-21 20:59:33 +01:00
color: modelData.active ? Colors.foreground : "transparent"
Text {
font.weight: 900
font.family: Appearance.font
font.pixelSize: Appearance.fontSize
anchors.centerIn: workspaceNumber
2025-12-21 20:59:33 +01:00
text: modelData.id
color: modelData.active ? Colors.background : Colors.foreground // Set contrasting color for workspace number
}
}
model: Hyprland.workspaces
2025-12-21 20:59:33 +01:00
}
}
}