diff options
author | r3pll <106473215+r3pll@users.noreply.github.com> | 2022-06-07 16:22:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-07 16:22:00 +0300 |
commit | 6d4418374bf6b53e4d771cd24c528e345838acaa (patch) | |
tree | 7d740d91bb71b0c9533938bcfc51643349c03a63 /src/ui/task_row.rs | |
parent | 02c76729565c06cfeaa0b1029bc9768cd3b46d7d (diff) | |
parent | f2c00a5f7da46d807b4f8a1c616ac9d98e264dac (diff) | |
download | Furtherance-6d4418374bf6b53e4d771cd24c528e345838acaa.tar.zst |
Merge pull request #2 from lakoliu/main
2
Diffstat (limited to 'src/ui/task_row.rs')
-rwxr-xr-x | src/ui/task_row.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ui/task_row.rs b/src/ui/task_row.rs index 0e46d81..cccc827 100755 --- a/src/ui/task_row.rs +++ b/src/ui/task_row.rs @@ -42,6 +42,8 @@ mod imp { pub task_tags_label: TemplateChild<gtk::Label>, #[template_child] pub total_time_label: TemplateChild<gtk::Label>, + #[template_child] + pub restart_task_btn: TemplateChild<gtk::Button>, pub tasks: Lazy<Mutex<Vec<Task>>>, pub total_time: RefCell<i64>, @@ -116,8 +118,6 @@ impl FurTaskRow { } else { let task_tags = format!("#{}", task_list[0].tags); imp.task_tags_label.set_text(&task_tags); - imp.row_box.set_margin_top(5); - imp.row_box.set_margin_bottom(5); } // Create right-click gesture @@ -131,6 +131,11 @@ impl FurTaskRow { self.add_controller(&gesture); + imp.restart_task_btn.connect_clicked(clone!(@strong task_list => move |_| { + let window = FurtheranceWindow::default(); + window.duplicate_task(task_list[0].clone()); + })); + // Add up all durations for task of said name to create total_time for task in &task_list { if task.task_name == task.task_name { |