aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/calendar/EventEditor.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/island/calendar/EventEditor.qml')
-rw-r--r--desktop/island/calendar/EventEditor.qml11
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