mpris stuff

This commit is contained in:
kossLAN 2025-06-15 22:52:00 -04:00
parent 233e12e094
commit f0673a66a2
Signed by: kossLAN
SSH key fingerprint: SHA256:bdV0x+wdQHGJ6LgmstH3KV8OpWY+OOFmJcPcB0wQPV8
10 changed files with 192 additions and 104 deletions

View file

@ -8,15 +8,15 @@ RowLayout {
spacing: 6
visible: Hyprland.monitors.values.length != 0
required property var screen
required property var screen
Repeater {
id: workspaceButtons
model: ScriptModel {
values: Hyprland.workspaces.values.slice().filter(
workspace => workspace.monitor === Hyprland.monitorFor(screen)
).sort((a,b) => {
return a.id - b.id;
});
)
}
Rectangle {
@ -26,7 +26,7 @@ RowLayout {
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: 12
Layout.preferredWidth: {
if (Hyprland.focusedMonitor.activeWorkspace.id == modelData.id)
if (Hyprland.focusedMonitor?.activeWorkspace?.id === modelData?.id)
return 25;
return 12;
@ -40,7 +40,7 @@ RowLayout {
if (workspaceButton.containsMouse) {
value = ShellSettings.colors["on_primary"];
} else if (Hyprland.focusedMonitor.activeWorkspace.id == modelData.id) {
} else if (Hyprland.focusedMonitor.activeWorkspace.id === modelData.id) {
value = ShellSettings.colors["primary"];
}
@ -55,6 +55,13 @@ RowLayout {
}
}
Behavior on color {
ColorAnimation {
duration: 100
easing.type: Easing.OutQuad
}
}
MouseArea {
id: workspaceButton
anchors.fill: parent