]> git.proxmox.com Git - ui/proxmox-yew-widget-toolkit.git/commitdiff
list: add separator property
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 13 Dec 2024 08:43:13 +0000 (09:43 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 13 Dec 2024 08:43:13 +0000 (09:43 +0100)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
src/widget/list/mod.rs

index f7b8fa82e542c14c10b893969aa32e82ed14dbdc..da6bd9ec029cbf2cc2e3a5e7981a7989171bf0b5 100644 (file)
@@ -92,6 +92,11 @@ pub struct List {
     #[prop_or(22)]
     #[builder]
     pub min_row_height: u64,
+
+    /// Add a line as separator between list items.
+    #[prop_or_default]
+    #[builder]
+    pub separator: bool,
 }
 
 impl List {
@@ -281,6 +286,7 @@ impl PwtList {
                         .key(format!("row-{index}"))
                         .force_height(0)
                         .tile_pos(index)
+                        .separator(props.separator)
                         .resize_callback(Some(self.tile_resize_callback.clone()));
 
                     //row.set_attribute("role", "listitem");
@@ -295,6 +301,7 @@ impl PwtList {
             let row = ListTileObserver::new(props.renderer.emit(pos))
                 .key(format!("row-{pos}"))
                 .tile_pos(pos)
+                .separator(props.separator)
                 .resize_callback(Some(self.tile_resize_callback.clone()));
 
             content.add_child(row);