First commit
This commit is contained in:
67
config/aurora/modules/Workspaces.qml
Normal file
67
config/aurora/modules/Workspaces.qml
Normal file
@@ -0,0 +1,67 @@
|
||||
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: Pywal.colors.color1
|
||||
radius: 3
|
||||
anchors.fill: parent
|
||||
ColumnLayout {
|
||||
id: lay
|
||||
Repeater {
|
||||
id: rep
|
||||
|
||||
property var ws: {
|
||||
let arr = [];
|
||||
Hyprland.workspaces.values.forEach((w) => { if(w.id > 0) arr.push(w) })
|
||||
return arr;
|
||||
}
|
||||
|
||||
model: ws
|
||||
WrapperMouseArea {
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
ClippingWrapperRectangle {
|
||||
id: rect
|
||||
radius: 3
|
||||
implicitWidth: 24
|
||||
implicitHeight: 24
|
||||
color: {
|
||||
Hyprland.focusedWorkspace.id == rep.model[index].id
|
||||
? Pywal.colors.color13
|
||||
: containsMouse
|
||||
? Pywal.colors.color12
|
||||
: Pywal.colors.color4
|
||||
}
|
||||
|
||||
Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
text: rep.model[index].id
|
||||
|
||||
color: {
|
||||
Hyprland.focusedWorkspace.id == rep.model[index].id
|
||||
? Pywal.colors.color1
|
||||
: Pywal.special.foreground
|
||||
}
|
||||
}
|
||||
}
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
rep.model[index].activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user