Skip to content

Commit

Permalink
feat(segmented_button): add len method
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony4dev authored Feb 13, 2025
1 parent cba28b1 commit 0b7e234
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/widget/segmented_button/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ where
self.items.get(id).map_or(false, |e| e.enabled)
}

/// Get number of items in the model.
pub fn len(&self) -> usize {
self.order.len()
}

/// Iterates across items in the model in the order that they are displayed.
pub fn iter(&self) -> impl Iterator<Item = Entity> + '_ {
self.order.iter().copied()
Expand Down

0 comments on commit 0b7e234

Please sign in to comment.