feat(segmented_button): paginate tabs when width is too narrow
This commit is contained in:
parent
05f8ffeef1
commit
ca92049ab6
3 changed files with 469 additions and 119 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue