mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
bar/workspaces: filter by monitor, switch to scriptmodel
This commit is contained in:
parent
9aa51c86da
commit
c2a80e1044
2 changed files with 14 additions and 11 deletions
|
|
@ -1,23 +1,23 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import ".."
|
||||
|
||||
RowLayout {
|
||||
property var sortedWorkspaces: {
|
||||
let values = Hyprland.workspaces.values.slice();
|
||||
values.sort(function (a, b) {
|
||||
return a.id - b.id;
|
||||
});
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
spacing: 6
|
||||
visible: Hyprland.monitors.values.length != 0
|
||||
|
||||
required property var screen
|
||||
|
||||
Repeater {
|
||||
model: parent.sortedWorkspaces
|
||||
model: ScriptModel {
|
||||
values: Hyprland.workspaces.values.slice().filter(
|
||||
workspace => workspace.monitor === Hyprland.monitorFor(screen)
|
||||
).sort((a,b) => {
|
||||
return a.id - b.id;
|
||||
});
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
required property var modelData
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue