mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-04 18:53:19 +00:00
Replace 'add event window' with popup
This commit is contained in:
parent
c804ce1c7b
commit
2e1e5db5ea
10 changed files with 50 additions and 204 deletions
43
src/modals/AddEventModal.slint
Normal file
43
src/modals/AddEventModal.slint
Normal file
|
@ -0,0 +1,43 @@
|
|||
import { Palette } from "@selenite";
|
||||
import { VTextInput } from "../../external/selenite/components/TextInput.slint";
|
||||
import { VButton, VText, VDatePicker } from "../../external/selenite/components/index.slint";
|
||||
import { AppWindowActions } from "../windows/AppWindow/Actions.slint";
|
||||
import { Modal } from "../../external/selenite/components/Modal.slint";
|
||||
import { VTimePicker } from "../../external/selenite/components/TimePicker.slint";
|
||||
|
||||
export component AddEventModal inherits Modal {
|
||||
public function open() {
|
||||
root.show();
|
||||
}
|
||||
|
||||
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
|
||||
});
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue