From bfdc3ce1e1be950dc810d19490d0b0a8ccaea3e8 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 13 Nov 2026 09:35:54 +0100 Subject: feat(calendar): end time follows the start, default length setting Moving an event's start now moves its end by the island's default event length, whether the start is typed, wheeled or picked, rolling into the next day past midnight. A multi-day timed event keeps its end, since snapping it to the start's day would drop the other days. Typing follows on every edit that normalises to a valid time, so Save without leaving the field still sees the moved end. A new event gets the same length. The length lives in Prefs as island.eventMinutes (5 to 1440, default 60) and is set on a new Island bar group in the settings window, which the island's other settings will join. Co-Authored-By: Claude Opus 5.5 --- desktop/island/calendar/EventEditor.qml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'desktop/island/calendar/EventEditor.qml') diff --git a/desktop/island/calendar/EventEditor.qml b/desktop/island/calendar/EventEditor.qml index 41815e3..727e1df 100644 --- a/desktop/island/calendar/EventEditor.qml +++ b/desktop/island/calendar/EventEditor.qml @@ -55,7 +55,14 @@ Column { function setTime(key, value) { (key === "startTime" ? startTime : endTime).input.text = value; - ed.set(key, value); + if (key === "startTime") ed.setStart(value); + else ed.set(key, value); + } + + // The end follows the start by the island's default event length. + function setStart(text) { + ed.draft = Cal.withStart(ed.draft, text, Prefs.island.eventMinutes); + endTime.input.text = ed.draft.endTime; } // A click in the time picker: an hour keeps the minutes, a minute keeps @@ -195,7 +202,7 @@ Column { id: startTime width: 62 visible: !ed.draft.allDay - input.onTextEdited: ed.set("startTime", input.text) + input.onTextEdited: ed.setStart(input.text) input.onEditingFinished: if (Cal.normTime(input.text) !== input.text) ed.setTime("startTime", Cal.normTime(input.text)) MouseArea { anchors.fill: parent -- cgit v1.2.3