diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-13 09:35:54 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-13 09:35:54 +0100 |
| commit | bfdc3ce1e1be950dc810d19490d0b0a8ccaea3e8 (patch) | |
| tree | be3223e1cd0691c1d45977c9dd0aad2be0274914 /desktop/island/calendar/EventEditor.qml | |
| parent | 9c47ad7c10aa5a04de738a5d41acc01cc0e5e059 (diff) | |
| download | quickshell-bfdc3ce1e1be950dc810d19490d0b0a8ccaea3e8.tar.gz quickshell-bfdc3ce1e1be950dc810d19490d0b0a8ccaea3e8.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'desktop/island/calendar/EventEditor.qml')
| -rw-r--r-- | desktop/island/calendar/EventEditor.qml | 11 |
1 files changed, 9 insertions, 2 deletions
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 |
