2025-01-07 22:37:12 +04:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
2025-01-08 11:17:54 +04:00
|
|
|
import Quickshell
|
|
|
|
import Quickshell.Hyprland
|
2025-01-07 22:37:12 +04:00
|
|
|
|
2025-01-10 09:26:56 +04:00
|
|
|
ListView {
|
2025-01-09 23:04:06 +04:00
|
|
|
id: workspaceList
|
|
|
|
property var workspaceArray: Array.from({ length: 10}, (_, i) => ({
|
|
|
|
id: i + 1,
|
|
|
|
text: i + 1,
|
|
|
|
visible: Hyprland.workspaces.values.some(e => e.id === i + 1),
|
|
|
|
active: Hyprland.focusedMonitor.activeWorkspace.id === i + 1
|
|
|
|
}))
|
2025-01-09 13:42:16 +04:00
|
|
|
|
2025-01-10 09:26:56 +04:00
|
|
|
model: workspaceArray
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.centerIn: parent
|
|
|
|
height: 500
|
|
|
|
width: 60
|
|
|
|
spacing: 2
|
|
|
|
delegate: Item {
|
|
|
|
width: Math.max((modelData.active) ? 50 : 40, 50)
|
|
|
|
height: 10
|
|
|
|
Rectangle {
|
2025-01-09 23:04:06 +04:00
|
|
|
id: workspace
|
2025-01-10 09:26:56 +04:00
|
|
|
width: (modelData.active) ? 50 : 40
|
|
|
|
height: 10
|
|
|
|
radius: height / 2
|
|
|
|
border.width: 1
|
|
|
|
border.color: (modelData.active) ? "#FFF8C8DC" : (modelData.visible) ? "#3399FF" : "#FFFFFF"
|
|
|
|
anchors.centerIn: parent
|
2025-01-09 23:04:06 +04:00
|
|
|
}
|
|
|
|
}
|
2025-01-09 13:42:16 +04:00
|
|
|
}
|