mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-04 10:43:19 +00:00
Move all UI code into new 'ui' directory
This commit is contained in:
parent
00d9cbe7ef
commit
0046cb9bbb
21 changed files with 94 additions and 93 deletions
49
src/ui/modals/AddEventModal.slint
Normal file
49
src/ui/modals/AddEventModal.slint
Normal file
|
@ -0,0 +1,49 @@
|
|||
import { Palette } from "@selenite";
|
||||
import { VTextInput } from "@selenite";
|
||||
import { VButton, VText, VDatePicker } from "@selenite";
|
||||
import { AppActions } from "../Actions.slint";
|
||||
import { Modal } from "@selenite";
|
||||
import { VTimePicker } from "@selenite";
|
||||
import { ComboBox } from "std-widgets.slint";
|
||||
import { AppModels } from "../Models.slint";
|
||||
|
||||
export component AddEventModal inherits Modal {
|
||||
public function open() {
|
||||
root.show();
|
||||
}
|
||||
|
||||
VerticalLayout {
|
||||
padding: 16px;
|
||||
spacing: 8px;
|
||||
sourceInput := ComboBox {
|
||||
model: AppModels.available-sources-strings;
|
||||
}
|
||||
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 => {
|
||||
AppActions.create-event({
|
||||
source-id: AppModels.get-source-id-from-name(sourceInput.current-value),
|
||||
title: titleInput.text,
|
||||
date: dateInput.date,
|
||||
starts-at: startTimeInput.time,
|
||||
ends-at: endTimeInput.time
|
||||
});
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue