52 lines
1.0 KiB
QML
52 lines
1.0 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
import QtQuick.Layouts
|
|
|
|
Rectangle {
|
|
|
|
implicitWidth: content.implicitWidth
|
|
implicitHeight: content.implicitHeight
|
|
color: "transparent"
|
|
|
|
Row {
|
|
id: content
|
|
anchors.fill: parent
|
|
|
|
|
|
Repeater {
|
|
model: ScriptModel {
|
|
values: Hyprland.workspaces.values.filter(e => e.id >= 0)
|
|
}
|
|
|
|
Rectangle {
|
|
required property HyprlandWorkspace modelData
|
|
property bool hovered: false
|
|
|
|
width: 25
|
|
height: 20
|
|
color: "transparent"
|
|
|
|
Text {
|
|
text: modelData.name
|
|
color: modelData.active ? "#09608c" : "#cccccc"
|
|
anchors.centerIn: parent
|
|
font.pixelSize: 14
|
|
}
|
|
|
|
MouseArea {
|
|
anchors.fill: parent
|
|
hoverEnabled: true
|
|
onClicked: {
|
|
modelData.activate()
|
|
parent.hovered = false
|
|
}
|
|
|
|
onEntered: parent.hovered = !modelData.active
|
|
onExited: parent.hovered = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|