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/Prefs.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/Prefs.qml')
| -rw-r--r-- | desktop/Prefs.qml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop/Prefs.qml b/desktop/Prefs.qml index ef2ac72..0861258 100644 --- a/desktop/Prefs.qml +++ b/desktop/Prefs.qml @@ -84,6 +84,15 @@ Singleton { root.write(Object.assign({}, root.doc, { bootlogo: root.bootlogo })); } + // 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 }) + property var island: islandDefaults + function setIsland(changes) { + root.island = Object.assign({}, root.island, changes); + root.write(Object.assign({}, root.doc, { island: root.island })); + } + // The whole parsed object, so a write keeps keys this version does not // know about. property var doc: ({}) @@ -154,6 +163,11 @@ Singleton { const bl = parsed.bootlogo && typeof parsed.bootlogo === "object" && !Array.isArray(parsed.bootlogo) ? parsed.bootlogo : {}; root.bootlogo = Object.assign({}, root.bootlogoDefaults, bl); + const isl = parsed.island && typeof parsed.island === "object" ? parsed.island : {}; + root.island = { + eventMinutes: Number.isInteger(isl.eventMinutes) && isl.eventMinutes >= 5 && isl.eventMinutes <= 1440 + ? isl.eventMinutes : 60, + }; } FileView { |
