Skip to content

Commit 0b7e234

Browse files
authored
feat(segmented_button): add len method
1 parent cba28b1 commit 0b7e234

File tree

1 file changed

+5
-0
lines changed
  • src/widget/segmented_button/model

1 file changed

+5
-0
lines changed

src/widget/segmented_button/model/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,11 @@ where
310310
self.items.get(id).map_or(false, |e| e.enabled)
311311
}
312312

313+
/// Get number of items in the model.
314+
pub fn len(&self) -> usize {
315+
self.order.len()
316+
}
317+
313318
/// Iterates across items in the model in the order that they are displayed.
314319
pub fn iter(&self) -> impl Iterator<Item = Entity> + '_ {
315320
self.order.iter().copied()

0 commit comments

Comments
 (0)