Replace 'add event window' with popup

This commit is contained in:
Vyn 2025-06-24 10:03:50 +02:00
parent c804ce1c7b
commit 2e1e5db5ea
Signed by: vyn
GPG key ID: E1B2BE34E7A971E7
10 changed files with 50 additions and 204 deletions

View file

@ -4,10 +4,11 @@ import { Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets
import { TaskLine } from "../../../components/TaskLine.slint";
import { EventGroup } from "../../../components/EventGroup.slint";
import { Calendar } from "../../../components/Calendar.slint";
import { VPopupIconMenu, VDatePicker, VTimePicker, VCheckBox, VButton, VTag, VText, VTextInput, Svg, Palette } from "@selenite";
import { VDatePicker, VTimePicker, VCheckBox, VButton, VTag, VText, VTextInput, Svg, Palette } from "@selenite";
import { CreateTaskOrEvent } from "../../../components/CreateTaskOrEvent.slint";
import { Utils } from "../../../shared/Utils.slint";
import { VActionButton } from "../../../../external/selenite/components/index.slint";
import { AddEventModal } from "../../../modals/AddEventModal.slint";
export component CalendarView inherits Rectangle {
@ -15,49 +16,7 @@ export component CalendarView inherits Rectangle {
private property<string> icon-not-visible: Svg.not-visible;
private property<bool> completed-tasks-visible: false;
createEventPopup := PopupWindow {
x: parent.width / 2 - 200px;
y: parent.height / 2 - 300px;
close-policy: close-on-click-outside;
background := Rectangle {
height: 100%;
width: 100%;
background: Palette.background1;
border-color: Palette.popup-border;
border-width: 1px;
border-radius: 4px;
}
VerticalLayout {
padding: 16px;
spacing: 8px;
titleInput := VTextInput {
label: "title";
}
VText { text: "on"; vertical-alignment: bottom;}
dateInput := VDatePicker {
enabled: true;
}
HorizontalLayout {
spacing: 4px;
VText { text: "between"; vertical-alignment: bottom; }
startTimeInput := VTimePicker { }
VText { text: "and"; vertical-alignment: bottom; }
endTimeInput := VTimePicker { }
}
VButton {
text: "Create";
clicked => {
AppWindowActions.create-event({
title: titleInput.text,
date: dateInput.date,
startsAt: startTimeInput.time,
endsAt: endTimeInput.time
});
createEventPopup.close();
}
}
}
}
createEventPopup := AddEventModal {}
VerticalLayout {
padding: 16px;