gardesk/garfield / ffeb268

Browse files

breadcrumb: add set_recents method

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
ffeb268a42339caad968d3fb4b47f0db469f6ea7
Parents
4f2a50a
Tree
f415f95

1 changed file

StatusFile+-
M garfield/src/ui/breadcrumb.rs 13 0
garfield/src/ui/breadcrumb.rsmodified
@@ -38,6 +38,19 @@ impl Breadcrumb {
3838
         }
3939
     }
4040
 
41
+    /// Set the breadcrumb to show "Recents" as a non-navigable label.
42
+    pub fn set_recents(&mut self) {
43
+        self.segments.clear();
44
+        self.hovered = None;
45
+        // Add a single non-navigable "Recents" segment
46
+        // Using an empty path so clicking does nothing
47
+        self.segments.push(Segment {
48
+            text: "Recents".to_string(),
49
+            path: PathBuf::new(),
50
+            bounds: Rect::new(0, 0, 0, 0),
51
+        });
52
+    }
53
+
4154
     /// Update the path displayed.
4255
     pub fn set_path(&mut self, path: &Path) {
4356
         self.segments.clear();