mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-01 17:03:19 +00:00
Allow deletion of unscheduled tasks
This commit is contained in:
parent
2aa039e5fc
commit
25aca40143
2 changed files with 12 additions and 3 deletions
9
external/mirai-core/src/BaseSource.cpp
vendored
9
external/mirai-core/src/BaseSource.cpp
vendored
|
@ -105,6 +105,15 @@ void BaseSource::deleteTask(const TaskItem &taskToDelete)
|
|||
}
|
||||
}
|
||||
}
|
||||
unscheduledTasks_.erase(
|
||||
std::remove_if(
|
||||
unscheduledTasks_.begin(), unscheduledTasks_.end(),
|
||||
[&](const std::unique_ptr<TaskItem> &task) {
|
||||
return task->id() == taskToDelete.id();
|
||||
}
|
||||
),
|
||||
unscheduledTasks_.end()
|
||||
);
|
||||
}
|
||||
|
||||
Event *BaseSource::getEventById(int eventId)
|
||||
|
|
|
@ -66,7 +66,7 @@ export component MainView inherits Rectangle {
|
|||
border-width: newTaskTitleInput.text != "" ? 4px : 0px;
|
||||
border-radius: newTaskTitleInput.text != "" ? 8px : 0px;
|
||||
animate border-color, border-width {
|
||||
duration: 500ms;
|
||||
duration: 250ms;
|
||||
}
|
||||
VerticalLayout {
|
||||
in-out property <int> task-or-event: 1;
|
||||
|
@ -81,7 +81,7 @@ export component MainView inherits Rectangle {
|
|||
opacity: newTaskTitleInput.text != "" ? 1 : 0;
|
||||
clip: true;
|
||||
animate max-height, opacity {
|
||||
duration: 500ms;
|
||||
duration: 250ms;
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
|
@ -124,7 +124,7 @@ export component MainView inherits Rectangle {
|
|||
}
|
||||
}
|
||||
newTaskTitleInput := VTextInput {
|
||||
placeholder: "Add task";
|
||||
placeholder: "Add new Task / Event";
|
||||
accepted => {
|
||||
if (task-or-event == 1) {
|
||||
Backend.createTask({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue