about summary refs log tree commit diff
path: root/src/ui/task_row.rs
diff options
context:
space:
mode:
authorRicky Kresslein <rk@lakoliu.com>2023-03-23 09:34:44 +0100
committerRicky Kresslein <rk@lakoliu.com>2023-03-23 09:34:44 +0100
commitdff62a9e31ff85305eb2d70b036ee25c90e4feeb (patch)
treef23dbd9fd581772a447b87daea9440cd76941624 /src/ui/task_row.rs
parent458d6b3f2934e72c5ed49b452730d2d9f4232812 (diff)
downloadFurtherance-dff62a9e31ff85305eb2d70b036ee25c90e4feeb.tar.zst
Use gtk-rs 0.6.4
Diffstat (limited to 'src/ui/task_row.rs')
-rw-r--r--src/ui/task_row.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ui/task_row.rs b/src/ui/task_row.rs
index 810d12e..611ebed 100644
--- a/src/ui/task_row.rs
+++ b/src/ui/task_row.rs
@@ -64,9 +64,10 @@ mod imp {
     }
 
     impl ObjectImpl for FurTaskRow {
-        fn constructed(&self, obj: &Self::Type) {
+        fn constructed(&self) {
+            let obj = self.obj();
             obj.setup_signals();
-            self.parent_constructed(obj);
+            self.parent_constructed();
         }
     }
 
@@ -85,7 +86,7 @@ impl FurTaskRow {
     pub fn new() -> Self {
         /* This should take a model, object, or vec filled with the description
         details and fill out the labels based on those. */
-        glib::Object::new(&[]).expect("Failed to create `FurTaskRow`.")
+        glib::Object::new::<FurTaskRow>()
     }
 
     fn setup_signals(&self) {
@@ -103,7 +104,7 @@ impl FurTaskRow {
     }
 
     pub fn set_row_labels(&self, task_list: Vec<Task>) {
-        let imp = imp::FurTaskRow::from_instance(&self);
+        let imp = imp::FurTaskRow::from_obj(&self);
         for task in task_list.clone() {
             imp.tasks.lock().unwrap().push(task);
         }
@@ -129,7 +130,7 @@ impl FurTaskRow {
             window.duplicate_task(task_list[0].clone());
         }));
 
-        self.add_controller(&gesture);
+        self.add_controller(gesture);
 
         imp.restart_task_btn
             .connect_clicked(clone!(@strong task_list => move |_| {
@@ -161,12 +162,12 @@ impl FurTaskRow {
     }
 
     pub fn get_tasks(&self) -> Vec<Task> {
-        let imp = imp::FurTaskRow::from_instance(&self);
+        let imp = imp::FurTaskRow::from_obj(&self);
         imp.tasks.lock().unwrap().to_vec()
     }
 
     pub fn get_total_time(&self) -> i64 {
-        let imp = imp::FurTaskRow::from_instance(&self);
+        let imp = imp::FurTaskRow::from_obj(&self);
         *imp.total_time.borrow()
     }
 }