From 8578a4ce1f31fb5786f10ef4e6f43c4d32fbe484 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 13 Nov 2026 09:35:55 +0100 Subject: feat(island): configurable pill order, dragged on a settings page The pills' x positions were written per pill around a fixed centre gap. They now come from one pillX() over Prefs.island.pills: the first two sit left of the screen's centre and the last two right, each a gap past the visible pills nearer the centre, so a hidden player or OBS pill leaves no hole and a panel still widens a pill away from the centre. The default order is the previous layout. The Island bar group gains a Pills page: four fixed slots with the centre marked, a pill dragged takes the nearest slot and the others step aside while it moves. The drag holds the pointer (preventStealing) so the page does not scroll under it. Co-Authored-By: Claude Opus 5.5 --- desktop/Prefs.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'desktop/Prefs.qml') diff --git a/desktop/Prefs.qml b/desktop/Prefs.qml index 0861258..09960c4 100644 --- a/desktop/Prefs.qml +++ b/desktop/Prefs.qml @@ -85,8 +85,9 @@ Singleton { } // The island bar's settings (modules/island): the length a new event gets, - // and that its end keeps from the start, in minutes. - readonly property var islandDefaults: ({ eventMinutes: 60 }) + // and that its end keeps from the start, in minutes; the pills left to + // right, the first two left of the screen's centre, the last two right. + readonly property var islandDefaults: ({ eventMinutes: 60, pills: ["media", "clock", "status", "obs"] }) property var island: islandDefaults function setIsland(changes) { root.island = Object.assign({}, root.island, changes); @@ -167,6 +168,9 @@ Singleton { root.island = { eventMinutes: Number.isInteger(isl.eventMinutes) && isl.eventMinutes >= 5 && isl.eventMinutes <= 1440 ? isl.eventMinutes : 60, + pills: Array.isArray(isl.pills) && isl.pills.length === 4 + && root.islandDefaults.pills.every(p => isl.pills.includes(p)) + ? isl.pills.slice() : root.islandDefaults.pills, }; } -- cgit v1.2.3