mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Rework mirai core
This commit is contained in:
parent
f885d355cd
commit
36a2fe9220
62 changed files with 27689 additions and 765 deletions
51
ui/components/TaskEdit.slint
Normal file
51
ui/components/TaskEdit.slint
Normal file
|
@ -0,0 +1,51 @@
|
|||
import { Backend, TaskData } from "../Backend.slint";
|
||||
import { Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
|
||||
import { VPopupIconMenu, VDatePicker, VTimePicker, VCheckBox, VButton, VTag, VText, VTextInput, Palette } from "@vynui";
|
||||
import { NewTaskData, SaveTaskData } from "../Backend.slint";
|
||||
|
||||
export component TaskEdit inherits VerticalLayout {
|
||||
in-out property <SaveTaskData> task;
|
||||
out property <bool> should-show;
|
||||
|
||||
public function show(task: SaveTaskData) {
|
||||
root.task = task;
|
||||
should-show = true;
|
||||
}
|
||||
public function close() {
|
||||
should-show = false;
|
||||
}
|
||||
callback accepted(SaveTaskData);
|
||||
|
||||
if !should-show : Rectangle {}
|
||||
|
||||
if should-show : Rectangle {
|
||||
background: Palette.background;
|
||||
border-radius: 8px;
|
||||
VerticalLayout {
|
||||
padding: 16px;
|
||||
spacing: 8px;
|
||||
|
||||
newTaskTitleInput := VTextInput {
|
||||
text: root.task.title;
|
||||
accepted => {
|
||||
root.accepted({
|
||||
id: task.id,
|
||||
sourceId: task.sourceId,
|
||||
title: newTaskTitleInput.text,
|
||||
scheduled: taskDateInput.date.year != 0,
|
||||
date: taskDateInput.date
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: start;
|
||||
spacing: 8px;
|
||||
taskDateInput := VDatePicker {
|
||||
date: task.date;
|
||||
enabled: true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue