usable
This commit is contained in:
@@ -19,13 +19,15 @@ Item {
|
||||
Repeater {
|
||||
id: rep
|
||||
|
||||
property var ws: {
|
||||
let arr = [];
|
||||
Hyprland.workspaces.values.forEach((w) => { if(w.id > 0) arr.push(w) })
|
||||
return arr;
|
||||
}
|
||||
model: Hyprland.workspaces.values.filter((w) => {
|
||||
if(w != null) {
|
||||
if(w.id > 0) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
model: ws
|
||||
WrapperMouseArea {
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
ClippingWrapperRectangle {
|
||||
@@ -34,7 +36,7 @@ Item {
|
||||
implicitWidth: 24
|
||||
implicitHeight: 24
|
||||
color: {
|
||||
Hyprland.focusedWorkspace.id == rep.model[index].id
|
||||
Hyprland?.focusedWorkspace?.id == rep.model[index].id
|
||||
? Pywal.colors.color13
|
||||
: containsMouse
|
||||
? Pywal.colors.color12
|
||||
@@ -48,7 +50,7 @@ Item {
|
||||
text: rep.model[index].id
|
||||
|
||||
color: {
|
||||
Hyprland.focusedWorkspace.id == rep.model[index].id
|
||||
Hyprland?.focusedWorkspace?.id == rep.model[index].id
|
||||
? Pywal.colors.color1
|
||||
: Pywal.special.foreground
|
||||
}
|
||||
@@ -56,7 +58,9 @@ Item {
|
||||
}
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
rep.model[index].activate()
|
||||
if(Hyprland?.focusedWorkspace?.id != rep.model[index].id) {
|
||||
rep.model[index].activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user