mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 01:13:19 +00:00
[WIP] Fix everything
This commit is contained in:
parent
15bd0f58a7
commit
686d86df6f
10 changed files with 212 additions and 125 deletions
|
@ -36,7 +36,7 @@ export component MainView inherits Rectangle {
|
|||
}
|
||||
|
||||
CreateTaskOrEvent {
|
||||
sources: AppModels.tasks-view.sources;
|
||||
sources: AppModels.available-sources-strings;
|
||||
create-task(data) => {
|
||||
AppActions.create-task({
|
||||
sourceId: data.sourceId,
|
||||
|
@ -67,6 +67,7 @@ export component MainView inherits Rectangle {
|
|||
VText {
|
||||
text: day.no-date ? "Unscheduled" : Utils.format-date(day.due-date);
|
||||
color: day.is-late ? Palette.orange : Palette.foreground;
|
||||
font-weight: 800;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
//VerticalLayout {
|
||||
|
@ -83,35 +84,52 @@ export component MainView inherits Rectangle {
|
|||
//}
|
||||
}
|
||||
|
||||
for source[source-index] in day.sources: VerticalLayout {
|
||||
VText {
|
||||
text: source.name;
|
||||
for source[source-index] in day.sources: Rectangle {
|
||||
Rectangle {
|
||||
x: 0;
|
||||
y: 0;
|
||||
width: 1px;
|
||||
height: 100%;
|
||||
background: source.color;
|
||||
border-radius: 4px;
|
||||
}
|
||||
if source.tasks.length > 0 : Rectangle {
|
||||
VerticalLayout {
|
||||
for task[taskIndex] in source.tasks: VerticalLayout {
|
||||
padding-top: taskIndex == 0 ? 16px : 0px;
|
||||
padding-bottom: 8px;
|
||||
TaskLine {
|
||||
title: task.title;
|
||||
source-name: AppModels.get-source-name-from-id(task.source-id);
|
||||
source-color: AppModels.get-source-color-from-id-as-color(task.source-id);
|
||||
checked: task.checked;
|
||||
allow-edit-date: true;
|
||||
delete => {
|
||||
AppActions.delete-task-clicked(task.source-id, task.id)
|
||||
}
|
||||
toggle-check => {
|
||||
AppActions.task-clicked(task.source-id, task.id);
|
||||
}
|
||||
edited(data) => {
|
||||
AppActions.save-task({
|
||||
id: task.id,
|
||||
sourceId: task.source-id,
|
||||
title: data.title,
|
||||
scheduled: data.scheduled,
|
||||
date: data.date
|
||||
})
|
||||
Rectangle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: source.color;
|
||||
opacity: 0.05;
|
||||
}
|
||||
VerticalLayout {
|
||||
padding: 16px;
|
||||
VText {
|
||||
text: source.name;
|
||||
color: source.color;
|
||||
font-weight: 800;
|
||||
}
|
||||
if source.tasks.length > 0 : Rectangle {
|
||||
VerticalLayout {
|
||||
for task[taskIndex] in source.tasks: VerticalLayout {
|
||||
padding-top: taskIndex == 0 ? 16px : 0px;
|
||||
padding-bottom: 8px;
|
||||
TaskLine {
|
||||
title: task.title;
|
||||
checked: task.checked;
|
||||
allow-edit-date: true;
|
||||
delete => {
|
||||
AppActions.delete-task-clicked(task.source-id, task.id)
|
||||
}
|
||||
toggle-check => {
|
||||
AppActions.task-clicked(task.source-id, task.id);
|
||||
}
|
||||
edited(data) => {
|
||||
AppActions.save-task({
|
||||
id: task.id,
|
||||
sourceId: task.source-id,
|
||||
title: data.title,
|
||||
scheduled: data.scheduled,
|
||||
date: data.date
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue