mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Add new 'Add task/event' bar directly in the main view
This commit is contained in:
parent
534da46a26
commit
2aa039e5fc
18 changed files with 399 additions and 51 deletions
|
@ -2,7 +2,7 @@ import { Date, Time, ComboBox } from "std-widgets.slint";
|
|||
import { VTimePicker, VDatePicker, VButton, VTextInput, VText, Palette } from "@vynui";
|
||||
import { Backend } from "../Backend.slint";
|
||||
|
||||
export struct NewEventParams {
|
||||
struct NewEventParams {
|
||||
sourceId: int,
|
||||
title: string,
|
||||
date: Date,
|
||||
|
@ -10,7 +10,7 @@ export struct NewEventParams {
|
|||
endsAt: Time
|
||||
}
|
||||
|
||||
export struct SaveEventParams {
|
||||
struct SaveEventParams {
|
||||
sourceId: int,
|
||||
id: int,
|
||||
title: string,
|
||||
|
@ -51,15 +51,15 @@ export component EventWindow inherits Window {
|
|||
enabled: eventId == -1;
|
||||
}
|
||||
|
||||
taskDateInput := VDatePicker {
|
||||
label: "Date";
|
||||
}
|
||||
|
||||
taskTitleInput := VTextInput {
|
||||
label: "Title";
|
||||
wrap: word-wrap;
|
||||
}
|
||||
|
||||
taskDateInput := VDatePicker {
|
||||
label: "Date";
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
spacing: 4px;
|
||||
eventStartTimeInput := VTimePicker {
|
||||
|
@ -71,7 +71,6 @@ export component EventWindow inherits Window {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
VButton {
|
||||
text: eventId == -1 ? "Create" : "Save";
|
||||
clicked => {
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Date, ComboBox } from "std-widgets.slint";
|
|||
import { VTextInput, VButton, VDatePicker, VText, VCheckBox, Palette } from "@vynui";
|
||||
import { Backend } from "../Backend.slint";
|
||||
|
||||
export struct NewTaskData {
|
||||
struct NewTaskData {
|
||||
sourceId: int,
|
||||
eventId: int,
|
||||
title: string,
|
||||
|
@ -10,7 +10,7 @@ export struct NewTaskData {
|
|||
date: Date
|
||||
}
|
||||
|
||||
export struct SaveTaskData {
|
||||
struct SaveTaskData {
|
||||
sourceId: int,
|
||||
id: int,
|
||||
title: string,
|
||||
|
@ -50,12 +50,6 @@ export component TaskWindow inherits Window {
|
|||
enabled: taskId == -1 && eventId == -1;
|
||||
}
|
||||
|
||||
taskTitleInput := VTextInput {
|
||||
label: "Content";
|
||||
wrap: word-wrap;
|
||||
accepted => { button.clicked() }
|
||||
}
|
||||
|
||||
scheduledInput := VCheckBox {
|
||||
text: "Scheduled";
|
||||
}
|
||||
|
@ -65,6 +59,12 @@ export component TaskWindow inherits Window {
|
|||
enabled: eventId == -1 && scheduledInput.checked;
|
||||
}
|
||||
|
||||
taskTitleInput := VTextInput {
|
||||
label: "Content";
|
||||
wrap: word-wrap;
|
||||
accepted => { button.clicked() }
|
||||
}
|
||||
|
||||
button := VButton {
|
||||
text: taskId == -1 ? "Create" : "Save";
|
||||
clicked => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue