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 {
}
}
}

View File

@@ -12,7 +12,7 @@ Singleton {
readonly property var notificationServer: notificationServer
readonly property var notificationsNumber: notificationServer.trackedNotifications.values.length
readonly property var maxShown: 3
readonly property int maxShown: 3
property bool receivingLock: false
property bool manualNotificationsMuted: false
@@ -31,7 +31,7 @@ Singleton {
return;
notif.tracked = true;
root.addNotification(trackedNotifications, notif);
root.addNotification(root.trackedNotifications, notif);
if (notif.lastGeneration)
return;
@@ -150,7 +150,6 @@ Singleton {
Quickshell.screens.filter(screen => screen.name == HyprlandService.focusedMon.name)[0];
}
anchors.top: true
margins.top: screen.height / 100
exclusiveZone: 0
implicitWidth: 400
implicitHeight: screen.height