mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-01 17:03:19 +00:00
Move Models and Actions slint definitions in the shared directory
This commit is contained in:
parent
f2f472a595
commit
72b004b7b0
15 changed files with 58 additions and 66 deletions
|
@ -150,7 +150,6 @@ export component Calendar inherits Rectangle {
|
||||||
ta := TouchArea {
|
ta := TouchArea {
|
||||||
pointer-event(e) => {
|
pointer-event(e) => {
|
||||||
if (e.button == PointerEventButton.right && e.kind == PointerEventKind.up) {
|
if (e.button == PointerEventButton.right && e.kind == PointerEventKind.up) {
|
||||||
debug(ta.mouse-x, " ", ta.mouse-y);
|
|
||||||
eventActionsPopup.show(ta.mouse-x, ta.mouse-y);
|
eventActionsPopup.show(ta.mouse-x, ta.mouse-y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { AppWindowModels } from "../windows/AppWindow/Models.slint";
|
import { AppModels } from "../shared/Models.slint";
|
||||||
import { Date, Time, Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
|
import { Date, Time, Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
|
||||||
import { VPopupIconMenu, VDatePicker, VTimePicker, VCheckBox, VButton, VActionButton, VTag, VText, Svg, VTextInput, Palette } from "@selenite";
|
import { VPopupIconMenu, VDatePicker, VTimePicker, VCheckBox, VButton, VActionButton, VTag, VText, Svg, VTextInput, Palette } from "@selenite";
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export component CreateTaskOrEvent inherits Rectangle {
|
||||||
|
|
||||||
function accepted() {
|
function accepted() {
|
||||||
root.create-task({
|
root.create-task({
|
||||||
sourceId: AppWindowModels.get-source-id-from-name(sourceInput.current-value),
|
sourceId: AppModels.get-source-id-from-name(sourceInput.current-value),
|
||||||
title: newTaskTitleInput.text,
|
title: newTaskTitleInput.text,
|
||||||
date: taskDateInput.date
|
date: taskDateInput.date
|
||||||
});
|
});
|
||||||
|
@ -39,7 +39,7 @@ export component CreateTaskOrEvent inherits Rectangle {
|
||||||
newTaskTitleInput := VTextInput {
|
newTaskTitleInput := VTextInput {
|
||||||
placeholder: "Enter new task";
|
placeholder: "Enter new task";
|
||||||
started-writting() => {
|
started-writting() => {
|
||||||
sourceInput.current-index = AppWindowModels.default-source-index;
|
sourceInput.current-index = AppModels.default-source-index;
|
||||||
}
|
}
|
||||||
accepted => { accepted() }
|
accepted => { accepted() }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Event } from "../windows/AppWindow/Models.slint";
|
import { Event } from "../shared/Models.slint";
|
||||||
import { ScrollView } from "std-widgets.slint";
|
import { ScrollView } from "std-widgets.slint";
|
||||||
import { VCheckBox, VTextInput, VButton, VActionButton, Svg, VTag, VPopupIconMenu, VText, Palette } from "@selenite";
|
import { VCheckBox, VTextInput, VButton, VActionButton, Svg, VTag, VPopupIconMenu, VText, Palette } from "@selenite";
|
||||||
import { TaskLine } from "./TaskLine.slint";
|
import { TaskLine } from "./TaskLine.slint";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Palette } from "@selenite";
|
import { Palette } from "@selenite";
|
||||||
import { VTextInput } from "../../external/selenite/components/TextInput.slint";
|
import { VTextInput } from "../../external/selenite/components/TextInput.slint";
|
||||||
import { VButton, VText, VDatePicker } from "../../external/selenite/components/index.slint";
|
import { VButton, VText, VDatePicker } from "../../external/selenite/components/index.slint";
|
||||||
import { AppWindowActions } from "../windows/AppWindow/Actions.slint";
|
import { AppActions } from "../shared/Actions.slint";
|
||||||
import { Modal } from "../../external/selenite/components/Modal.slint";
|
import { Modal } from "../../external/selenite/components/Modal.slint";
|
||||||
import { VTimePicker } from "../../external/selenite/components/TimePicker.slint";
|
import { VTimePicker } from "../../external/selenite/components/TimePicker.slint";
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ export component AddEventModal inherits Modal {
|
||||||
VButton {
|
VButton {
|
||||||
text: "Create";
|
text: "Create";
|
||||||
clicked => {
|
clicked => {
|
||||||
AppWindowActions.create-event({
|
AppActions.create-event({
|
||||||
title: titleInput.text,
|
title: titleInput.text,
|
||||||
date: dateInput.date,
|
date: dateInput.date,
|
||||||
startsAt: startTimeInput.time,
|
startsAt: startTimeInput.time,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Palette } from "@selenite";
|
import { Palette } from "@selenite";
|
||||||
import { VTextInput } from "../../external/selenite/components/TextInput.slint";
|
import { VTextInput } from "../../external/selenite/components/TextInput.slint";
|
||||||
import { VButton } from "../../external/selenite/components/index.slint";
|
import { VButton } from "../../external/selenite/components/index.slint";
|
||||||
import { AppWindowModels } from "../windows/AppWindow/Models.slint";
|
import { AppModels } from "../shared/Models.slint";
|
||||||
import { AppWindowActions } from "../windows/AppWindow/Actions.slint";
|
import { AppActions } from "../shared/Actions.slint";
|
||||||
import { Modal } from "../../external/selenite/components/Modal.slint";
|
import { Modal } from "../../external/selenite/components/Modal.slint";
|
||||||
|
|
||||||
export component AddSourceModal inherits Modal {
|
export component AddSourceModal inherits Modal {
|
||||||
|
@ -28,7 +28,7 @@ export component AddSourceModal inherits Modal {
|
||||||
VButton {
|
VButton {
|
||||||
text: "Add";
|
text: "Add";
|
||||||
clicked => {
|
clicked => {
|
||||||
AppWindowActions.add-source(name, path);
|
AppActions.add-source(name, path);
|
||||||
root.close();
|
root.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { Palette } from "@selenite";
|
import { Palette } from "@selenite";
|
||||||
import { VTextInput } from "../../external/selenite/components/TextInput.slint";
|
import { VTextInput } from "../../external/selenite/components/TextInput.slint";
|
||||||
import { VButton } from "../../external/selenite/components/index.slint";
|
import { VButton } from "../../external/selenite/components/index.slint";
|
||||||
import { AppWindowModels } from "../windows/AppWindow/Models.slint";
|
import { AppModels } from "../shared/Models.slint";
|
||||||
import { AppWindowActions } from "../windows/AppWindow/Actions.slint";
|
import { AppActions } from "../shared/Actions.slint";
|
||||||
import { Modal } from "../../external/selenite/components/Modal.slint";
|
import { Modal } from "../../external/selenite/components/Modal.slint";
|
||||||
|
|
||||||
export component EditSourceModal inherits Modal {
|
export component EditSourceModal inherits Modal {
|
||||||
|
@ -12,8 +12,8 @@ export component EditSourceModal inherits Modal {
|
||||||
|
|
||||||
public function edit(source-id: int) {
|
public function edit(source-id: int) {
|
||||||
source-id-to-edit = source-id;
|
source-id-to-edit = source-id;
|
||||||
root.name = AppWindowModels.get-source-name-from-id(source-id);
|
root.name = AppModels.get-source-name-from-id(source-id);
|
||||||
root.path = AppWindowModels.get-source-path-from-id(source-id);
|
root.path = AppModels.get-source-path-from-id(source-id);
|
||||||
root.show();
|
root.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ export component EditSourceModal inherits Modal {
|
||||||
VButton {
|
VButton {
|
||||||
text: "Save";
|
text: "Save";
|
||||||
clicked => {
|
clicked => {
|
||||||
AppWindowActions.edit-source(source-id-to-edit, name, path);
|
AppActions.edit-source(source-id-to-edit, name, path);
|
||||||
root.close();
|
root.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { Date, Time } from "std-widgets.slint";
|
import { Date, Time } from "std-widgets.slint";
|
||||||
import { CalendarDay } from "../../components/Calendar.slint";
|
import { CalendarDay } from "../components/Calendar.slint";
|
||||||
|
|
||||||
export struct NewTaskData {
|
export struct NewTaskData {
|
||||||
sourceId: int,
|
sourceId: int,
|
||||||
|
@ -29,21 +29,15 @@ export struct CreateEventParams {
|
||||||
endsAt: Time
|
endsAt: Time
|
||||||
}
|
}
|
||||||
|
|
||||||
export global AppWindowActions {
|
export global AppActions {
|
||||||
callback task-clicked(int, int);
|
callback task-clicked(int, int);
|
||||||
callback source-clicked(int);
|
callback source-clicked(int);
|
||||||
callback add-source(name: string, path: string);
|
callback add-source(name: string, path: string);
|
||||||
callback edit-source(sourceId: int, name: string, path: string);
|
callback edit-source(sourceId: int, name: string, path: string);
|
||||||
|
|
||||||
callback open-new-task-form(OpenNewTaskFormParams);
|
|
||||||
callback open-edit-task-form(int, int);
|
|
||||||
callback open-new-event-form();
|
|
||||||
callback open-edit-event-form(int, int);
|
|
||||||
callback toggle-show-completed-tasks();
|
callback toggle-show-completed-tasks();
|
||||||
callback delete-task-clicked(int, int);
|
callback delete-task-clicked(int, int);
|
||||||
|
|
||||||
callback open-add-event-window();
|
|
||||||
|
|
||||||
callback create-task(NewTaskData);
|
callback create-task(NewTaskData);
|
||||||
callback save-task(SaveTaskData);
|
callback save-task(SaveTaskData);
|
||||||
callback create-event(CreateEventParams);
|
callback create-event(CreateEventParams);
|
|
@ -1,5 +1,5 @@
|
||||||
import { Date, Time } from "std-widgets.slint";
|
import { Date, Time } from "std-widgets.slint";
|
||||||
import { CalendarDay } from "../../components/Calendar.slint";
|
import { CalendarDay } from "../components/Calendar.slint";
|
||||||
|
|
||||||
export struct Source {
|
export struct Source {
|
||||||
id: int,
|
id: int,
|
||||||
|
@ -37,7 +37,7 @@ export struct Day {
|
||||||
relativeDaysDiff: int
|
relativeDaysDiff: int
|
||||||
}
|
}
|
||||||
|
|
||||||
export global AppWindowModels {
|
export global AppModels {
|
||||||
in-out property<[Source]> sources-selected;
|
in-out property<[Source]> sources-selected;
|
||||||
in-out property<int> default-source-index;
|
in-out property<int> default-source-index;
|
||||||
in-out property<[string]> sources;
|
in-out property<[string]> sources;
|
|
@ -1,7 +1,7 @@
|
||||||
import { AppWindowModels } from "windows/AppWindow/Models.slint";
|
import { AppModels } from "shared/Models.slint";
|
||||||
import { AppWindowActions } from "windows/AppWindow/Actions.slint";
|
import { AppActions } from "shared/Actions.slint";
|
||||||
import { AppWindow } from "windows/AppWindow/AppWindow.slint";
|
import { AppWindow } from "windows/AppWindow/AppWindow.slint";
|
||||||
import { Utils } from "shared/Utils.slint";
|
import { Utils } from "shared/Utils.slint";
|
||||||
import { Palette } from "@selenite";
|
import { Palette } from "@selenite";
|
||||||
|
|
||||||
export { Utils, Palette, AppWindow, AppWindowModels, AppWindowActions }
|
export { Utils, Palette, AppWindow, AppModels, AppActions }
|
||||||
|
|
|
@ -228,7 +228,6 @@ void AppWindow::setupCallbacks()
|
||||||
});
|
});
|
||||||
|
|
||||||
actions().on_create_event([&](ui::CreateEventParams newEventParams) {
|
actions().on_create_event([&](ui::CreateEventParams newEventParams) {
|
||||||
std::println("okkk");
|
|
||||||
const ui::Date &date = newEventParams.date;
|
const ui::Date &date = newEventParams.date;
|
||||||
const std::string dateStr = SlintDateToStdString(date);
|
const std::string dateStr = SlintDateToStdString(date);
|
||||||
const auto sourceId = models().get_default_source_index();
|
const auto sourceId = models().get_default_source_index();
|
||||||
|
@ -416,12 +415,12 @@ void AppWindow::run()
|
||||||
mainWindow_->run();
|
mainWindow_->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
const ui::AppWindowModels &AppWindow::models()
|
const ui::AppModels &AppWindow::models()
|
||||||
{
|
{
|
||||||
return mainWindow_->global<ui::AppWindowModels>();
|
return mainWindow_->global<ui::AppModels>();
|
||||||
}
|
}
|
||||||
|
|
||||||
const ui::AppWindowActions &AppWindow::actions()
|
const ui::AppActions &AppWindow::actions()
|
||||||
{
|
{
|
||||||
return mainWindow_->global<ui::AppWindowActions>();
|
return mainWindow_->global<ui::AppActions>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,8 @@ class AppWindow
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupCallbacks();
|
void setupCallbacks();
|
||||||
const ui::AppWindowModels &models();
|
const ui::AppModels &models();
|
||||||
const ui::AppWindowActions &actions();
|
const ui::AppActions &actions();
|
||||||
|
|
||||||
std::shared_ptr<slint::VectorModel<ui::Source>> sources_;
|
std::shared_ptr<slint::VectorModel<ui::Source>> sources_;
|
||||||
std::shared_ptr<slint::VectorModel<ui::Day>> days_;
|
std::shared_ptr<slint::VectorModel<ui::Day>> days_;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { AppWindowModels } from "Models.slint";
|
import { AppModels } from "../../shared/Models.slint";
|
||||||
import { Button, VerticalBox, CheckBox } from "std-widgets.slint";
|
import { Button, VerticalBox, CheckBox } from "std-widgets.slint";
|
||||||
import { MainView } from "views/TasksView.slint";
|
import { MainView } from "views/TasksView.slint";
|
||||||
import { Palette } from "@selenite";
|
import { Palette } from "@selenite";
|
||||||
|
@ -6,7 +6,7 @@ import { CalendarView } from "views/CalendarView.slint";
|
||||||
import { VButton } from "../../../external/selenite/components/Button.slint";
|
import { VButton } from "../../../external/selenite/components/Button.slint";
|
||||||
import { ToggleButton } from "../../../external/selenite/components/index.slint";
|
import { ToggleButton } from "../../../external/selenite/components/index.slint";
|
||||||
import { VTextInput } from "../../../external/selenite/components/TextInput.slint";
|
import { VTextInput } from "../../../external/selenite/components/TextInput.slint";
|
||||||
import { AppWindowActions } from "Actions.slint";
|
import { AppActions } from "../../shared/Actions.slint";
|
||||||
import { SideBar } from "views/SideBar.slint";
|
import { SideBar } from "views/SideBar.slint";
|
||||||
|
|
||||||
export component AppWindow inherits Window {
|
export component AppWindow inherits Window {
|
||||||
|
@ -69,4 +69,4 @@ export component AppWindow inherits Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { AppWindowModels, Palette } // Export to make it visible to the C++ backend
|
export { AppModels, Palette } // Export to make it visible to the C++ backend
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AppWindowModels, TaskData } from "../Models.slint";
|
import { AppModels, TaskData } from "../../../shared/Models.slint";
|
||||||
import { AppWindowActions, NewTaskData, SaveTaskData } from "../Actions.slint";
|
import { AppActions, NewTaskData, SaveTaskData } from "../../../shared/Actions.slint";
|
||||||
import { Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
|
import { Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
|
||||||
import { TaskLine } from "../../../components/TaskLine.slint";
|
import { TaskLine } from "../../../components/TaskLine.slint";
|
||||||
import { EventGroup } from "../../../components/EventGroup.slint";
|
import { EventGroup } from "../../../components/EventGroup.slint";
|
||||||
|
@ -39,9 +39,9 @@ export component CalendarView inherits Rectangle {
|
||||||
}
|
}
|
||||||
Calendar {
|
Calendar {
|
||||||
delete-event-request(source-id, event-id) => {
|
delete-event-request(source-id, event-id) => {
|
||||||
AppWindowActions.delete-event(source-id, event-id)
|
AppActions.delete-event(source-id, event-id)
|
||||||
}
|
}
|
||||||
days: AppWindowModels.calendar;
|
days: AppModels.calendar;
|
||||||
current-date: Utils.current-date;
|
current-date: Utils.current-date;
|
||||||
current-time: Utils.current-time;
|
current-time: Utils.current-time;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AppWindowModels, TaskData } from "../Models.slint";
|
import { AppModels, TaskData } from "../../../shared/Models.slint";
|
||||||
import { AppWindowActions } from "../Actions.slint";
|
import { AppActions } from "../../../shared/Actions.slint";
|
||||||
import { VButton, ToggleButton, VActionButton, VText, Svg, Palette } from "@selenite";
|
import { VButton, ToggleButton, VActionButton, VText, Svg, Palette } from "@selenite";
|
||||||
import { EditSourceModal } from "../../../modals/EditSourceModal.slint";
|
import { EditSourceModal } from "../../../modals/EditSourceModal.slint";
|
||||||
import { AddSourceModal } from "../../../modals/AddSourceModal.slint";
|
import { AddSourceModal } from "../../../modals/AddSourceModal.slint";
|
||||||
|
@ -46,16 +46,16 @@ export component SideBar inherits Rectangle {
|
||||||
ToggleButton {
|
ToggleButton {
|
||||||
text: "All";
|
text: "All";
|
||||||
text-alignment: left;
|
text-alignment: left;
|
||||||
active: AppWindowModels.no-source-selected;
|
active: AppModels.no-source-selected;
|
||||||
clicked => { AppWindowActions.source-clicked(-1) }
|
clicked => { AppActions.source-clicked(-1) }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
for item[index] in AppWindowModels.sources-selected: ToggleButton {
|
for item[index] in AppModels.sources-selected: ToggleButton {
|
||||||
text: item.name;
|
text: item.name;
|
||||||
text-alignment: left;
|
text-alignment: left;
|
||||||
active: item.selected;
|
active: item.selected;
|
||||||
clicked => { AppWindowActions.source-clicked(item.id) }
|
clicked => { AppActions.source-clicked(item.id) }
|
||||||
VActionButton {
|
VActionButton {
|
||||||
visible: parent.active;
|
visible: parent.active;
|
||||||
icon-svg: Svg.cog;
|
icon-svg: Svg.cog;
|
||||||
|
@ -70,7 +70,7 @@ export component SideBar inherits Rectangle {
|
||||||
icon-svg: Svg.cog;
|
icon-svg: Svg.cog;
|
||||||
text: "Settings";
|
text: "Settings";
|
||||||
background: transparent;
|
background: transparent;
|
||||||
clicked => { AppWindowModels.open-settings-window() }
|
clicked => { AppModels.open-settings-window() }
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AppWindowModels, TaskData } from "../Models.slint";
|
import { AppModels, TaskData } from "../../../shared/Models.slint";
|
||||||
import { AppWindowActions, NewTaskData, SaveTaskData } from "../Actions.slint";
|
import { AppActions, NewTaskData, SaveTaskData } from "../../../shared/Actions.slint";
|
||||||
import { Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
|
import { Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
|
||||||
import { TaskLine } from "../../../components/TaskLine.slint";
|
import { TaskLine } from "../../../components/TaskLine.slint";
|
||||||
import { EventGroup } from "../../../components/EventGroup.slint";
|
import { EventGroup } from "../../../components/EventGroup.slint";
|
||||||
|
@ -23,7 +23,7 @@ export component MainView inherits Rectangle {
|
||||||
VButton {
|
VButton {
|
||||||
text: "Show/Hide completed tasks";
|
text: "Show/Hide completed tasks";
|
||||||
clicked => {
|
clicked => {
|
||||||
AppWindowActions.toggle-show-completed-tasks();
|
AppActions.toggle-show-completed-tasks();
|
||||||
completed-tasks-visible = !completed-tasks-visible;
|
completed-tasks-visible = !completed-tasks-visible;
|
||||||
}
|
}
|
||||||
icon-svg: completed-tasks-visible ? icon-visible : icon-not-visible;
|
icon-svg: completed-tasks-visible ? icon-visible : icon-not-visible;
|
||||||
|
@ -37,9 +37,9 @@ export component MainView inherits Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateTaskOrEvent {
|
CreateTaskOrEvent {
|
||||||
sources: AppWindowModels.sources;
|
sources: AppModels.sources;
|
||||||
create-task(data) => {
|
create-task(data) => {
|
||||||
AppWindowActions.create-task({
|
AppActions.create-task({
|
||||||
sourceId: data.sourceId,
|
sourceId: data.sourceId,
|
||||||
eventId: -1,
|
eventId: -1,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
|
@ -54,12 +54,12 @@ export component MainView inherits Rectangle {
|
||||||
horizontal-stretch: 1;
|
horizontal-stretch: 1;
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
if AppWindowModels.days.length == 0 && AppWindowModels.unscheduled-tasks.length == 0 : VText {
|
if AppModels.days.length == 0 && AppModels.unscheduled-tasks.length == 0 : VText {
|
||||||
text: "There is no task to show";
|
text: "There is no task to show";
|
||||||
horizontal-alignment: center;
|
horizontal-alignment: center;
|
||||||
vertical-alignment: center;
|
vertical-alignment: center;
|
||||||
}
|
}
|
||||||
for day[dayIndex] in AppWindowModels.days: VerticalLayout {
|
for day[dayIndex] in AppModels.days: VerticalLayout {
|
||||||
spacing: day.tasks.length > 0 ? 16px : 0px;
|
spacing: day.tasks.length > 0 ? 16px : 0px;
|
||||||
padding-bottom: 32px;
|
padding-bottom: 32px;
|
||||||
|
|
||||||
|
@ -92,19 +92,19 @@ export component MainView inherits Rectangle {
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
TaskLine {
|
TaskLine {
|
||||||
title: task.title;
|
title: task.title;
|
||||||
source-name: AppWindowModels.get-source-name-from-id(task.sourceId);
|
source-name: AppModels.get-source-name-from-id(task.sourceId);
|
||||||
scheduled: task.date.year != 0;
|
scheduled: task.date.year != 0;
|
||||||
date: day.date;
|
date: day.date;
|
||||||
checked: task.checked;
|
checked: task.checked;
|
||||||
allow-edit-date: true;
|
allow-edit-date: true;
|
||||||
delete => {
|
delete => {
|
||||||
AppWindowActions.delete-task-clicked(task.sourceId, task.id)
|
AppActions.delete-task-clicked(task.sourceId, task.id)
|
||||||
}
|
}
|
||||||
toggle-check => {
|
toggle-check => {
|
||||||
AppWindowActions.task-clicked(task.sourceId, task.id);
|
AppActions.task-clicked(task.sourceId, task.id);
|
||||||
}
|
}
|
||||||
edited(data) => {
|
edited(data) => {
|
||||||
AppWindowActions.save-task({
|
AppActions.save-task({
|
||||||
id: task.id,
|
id: task.id,
|
||||||
sourceId: task.sourceId,
|
sourceId: task.sourceId,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
|
@ -117,7 +117,7 @@ export component MainView inherits Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if AppWindowModels.unscheduled-tasks.length > 0 : VerticalLayout {
|
if AppModels.unscheduled-tasks.length > 0 : VerticalLayout {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
//background: Palette.card-background;
|
//background: Palette.card-background;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
@ -130,22 +130,22 @@ export component MainView inherits Rectangle {
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for task[taskIndex] in AppWindowModels.unscheduled-tasks: VerticalLayout {
|
for task[taskIndex] in AppModels.unscheduled-tasks: VerticalLayout {
|
||||||
padding-top: taskIndex == 0 ? 16px : 0px;
|
padding-top: taskIndex == 0 ? 16px : 0px;
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
TaskLine {
|
TaskLine {
|
||||||
title: task.title;
|
title: task.title;
|
||||||
source-name: AppWindowModels.get-source-name-from-id(task.sourceId);
|
source-name: AppModels.get-source-name-from-id(task.sourceId);
|
||||||
checked: task.checked;
|
checked: task.checked;
|
||||||
allow-edit-date: true;
|
allow-edit-date: true;
|
||||||
delete => {
|
delete => {
|
||||||
AppWindowActions.delete-task-clicked(task.sourceId, task.id)
|
AppActions.delete-task-clicked(task.sourceId, task.id)
|
||||||
}
|
}
|
||||||
toggle-check => {
|
toggle-check => {
|
||||||
AppWindowActions.task-clicked(task.sourceId, task.id);
|
AppActions.task-clicked(task.sourceId, task.id);
|
||||||
}
|
}
|
||||||
edited(data) => {
|
edited(data) => {
|
||||||
AppWindowActions.save-task({
|
AppActions.save-task({
|
||||||
id: task.id,
|
id: task.id,
|
||||||
sourceId: task.sourceId,
|
sourceId: task.sourceId,
|
||||||
title: data.title,
|
title: data.title,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue