Fix some styling, make some components bound

This commit is contained in:
2025-10-14 00:56:52 -03:00
parent 7e16362f96
commit 0498c2f3cb
8 changed files with 26 additions and 27 deletions

View File

@@ -3,9 +3,7 @@ pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Wayland
import Quickshell.Io
import qs.Common
Singleton {
id: root
@@ -24,15 +22,18 @@ Singleton {
const sorted = topLevels.sort((a, b) => {
if (a.monitor && b.monitor) {
const monitorCompare = a.monitor.name.localeCompare(b.monitor.name);
if (monitorCompare !== 0) return monitorCompare;
if (monitorCompare !== 0)
return monitorCompare;
}
if (a.workspace && b.workspace) {
const workspaceCompare = a.workspace.id - b.workspace.id;
if (workspaceCompare !== 0) return workspaceCompare;
if (workspaceCompare !== 0)
return workspaceCompare;
}
if (a.lastIpcObject?.at && b.lastIpcObject?.at) {
const xCompare = a.lastIpcObject.at[0] - b.lastIpcObject.at[0];
if (Math.abs(xCompare) > 10) return xCompare;
if (Math.abs(xCompare) > 10)
return xCompare;
return a.lastIpcObject.at[1] - b.lastIpcObject.at[1];
}
if (a.title && b.title)
@@ -52,11 +53,11 @@ Singleton {
id: retryTimer
interval: 300
repeat: false
onTriggered: refreshSortedDesktopApplications()
onTriggered: root.refreshSortedDesktopApplications()
}
function refreshSortedDesktopApplications() {
if (!Hyprland.toplevels || Hyprland.toplevels.size === 0)
if (!Hyprland.toplevels)
return;
try {
@@ -73,8 +74,6 @@ Singleton {
desktopEntry: entry
});
}
} catch (err) {
retryTimer.restart();
}
@@ -109,4 +108,3 @@ Singleton {
}
}
}