Files
Aurora/config/aurora/modules/Workspaces.qml
2026-04-09 11:16:48 -05:00

72 lines
2.2 KiB
QML

import QtQuick // for Text
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Hyprland
import Quickshell.Widgets
Item {
implicitHeight: 10 + rep.count * (2 * lay.spacing + 25)
implicitWidth: 30
Component.onCompleted: Hyprland.refreshWorkspaces()
ClippingWrapperRectangle {
color: Settings.colors.color1
radius: 3
anchors.fill: parent
ColumnLayout {
id: lay
Repeater {
id: rep
model: Hyprland.workspaces.values.filter((w) => {
if(w != null) {
if(w.id > 0) {
return true
}
}
return false
})
WrapperMouseArea {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
ClippingWrapperRectangle {
id: rect
radius: 3
implicitWidth: 24
implicitHeight: 24
color: {
Hyprland?.focusedWorkspace?.id == rep.model[index].id
? Settings.colors.color13
: containsMouse
? Settings.colors.color12
: Settings.colors.color4
}
Text {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: rep.model[index].id
color: {
Hyprland?.focusedWorkspace?.id == rep.model[index].id
? Settings.colors.color1
: Settings.special.foreground
}
}
}
hoverEnabled: true
onClicked: {
if(Hyprland?.focusedWorkspace?.id != rep.model[index].id) {
rep.model[index].activate()
}
}
}
}
}
}
}