From cf30a47c68254b1886a703355207607e4ca8db22 Mon Sep 17 00:00:00 2001 From: Vyn Date: Fri, 4 Jul 2025 11:04:10 +0200 Subject: [PATCH] Fix the 'show completed tasks' feature --- external/selenite | 2 +- src/app_logic.cpp | 5 ++++- src/ui/modals/AddEventModal.slint | 2 +- src/ui/windows/AppWindow/views/SideBar.slint | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/external/selenite b/external/selenite index 099b5ed..f154762 160000 --- a/external/selenite +++ b/external/selenite @@ -1 +1 @@ -Subproject commit 099b5edb0fa7c2fb016a348af448ff6b715844c3 +Subproject commit f154762629f5690d58098d86a99a9e51a00253b2 diff --git a/src/app_logic.cpp b/src/app_logic.cpp index 13a689e..e01a382 100644 --- a/src/app_logic.cpp +++ b/src/app_logic.cpp @@ -485,7 +485,8 @@ void app_logic::update_tasks_view() continue; } for (auto &task : source_group.tasks) { - if (task.has_due_date() && task.due_date() < today) { + if (task.has_due_date() && task.due_date() < today + && _should_hide_completed_tasks) { continue; } new_slint_tasks->push_back( @@ -554,10 +555,12 @@ void app_logic::hide_all_sources() void app_logic::show_completed_tasks() { + _should_hide_completed_tasks = false; } void app_logic::hide_completed_tasks() { + _should_hide_completed_tasks = true; } bool app_logic::should_hide_completed_tasks() const diff --git a/src/ui/modals/AddEventModal.slint b/src/ui/modals/AddEventModal.slint index 8edbe85..02021fc 100644 --- a/src/ui/modals/AddEventModal.slint +++ b/src/ui/modals/AddEventModal.slint @@ -21,8 +21,8 @@ export component AddEventModal inherits Modal { titleInput := VTextInput { label: "title"; } - VText { text: "on"; vertical-alignment: bottom;} dateInput := VDatePicker { + label: "on"; enabled: true; } HorizontalLayout { diff --git a/src/ui/windows/AppWindow/views/SideBar.slint b/src/ui/windows/AppWindow/views/SideBar.slint index 4185942..08065fb 100644 --- a/src/ui/windows/AppWindow/views/SideBar.slint +++ b/src/ui/windows/AppWindow/views/SideBar.slint @@ -42,7 +42,7 @@ export component SideBar inherits Rectangle { vertical-stretch: 1; VerticalLayout { vertical-stretch: 1; - spacing: 4px; + spacing: 8px; for source[index] in AppModels.sidebar-view.sources: HorizontalLayout { alignment: space-between; VText {