feat(segmented_button): paginate tabs when width is too narrow

This commit is contained in:
Michael Aaron Murphy 2024-01-23 14:31:37 +01:00 committed by Michael Murphy
parent 05f8ffeef1
commit ca92049ab6
3 changed files with 469 additions and 119 deletions

View file

@ -45,7 +45,12 @@ where
}
#[allow(clippy::cast_precision_loss)]
fn variant_button_bounds(&self, mut bounds: Rectangle, nth: usize) -> Rectangle {
fn variant_button_bounds(
&self,
_state: &LocalState,
mut bounds: Rectangle,
nth: usize,
) -> Option<Rectangle> {
let num = self.model.items.len();
if num != 0 {
let spacing = f32::from(self.spacing);
@ -56,7 +61,7 @@ where
}
}
bounds
Some(bounds)
}
#[allow(clippy::cast_precision_loss)]