refactor!(widget): rename view_switcher to tab_bar to match Figma docs
This commit is contained in:
parent
bfc84c4759
commit
ff9438c5ba
5 changed files with 14 additions and 16 deletions
|
|
@ -173,6 +173,8 @@ pub mod settings;
|
|||
pub mod spin_button;
|
||||
pub use spin_button::{spin_button, SpinButton};
|
||||
|
||||
pub mod tab_bar;
|
||||
|
||||
pub mod text;
|
||||
pub use text::{text, Text};
|
||||
|
||||
|
|
@ -206,9 +208,5 @@ pub mod tooltip {
|
|||
}
|
||||
}
|
||||
|
||||
pub mod view_switcher;
|
||||
pub use view_switcher::horizontal as horiontal_view_switcher;
|
||||
pub use view_switcher::vertical as vertical_view_switcher;
|
||||
|
||||
pub mod warning;
|
||||
pub use warning::*;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ where
|
|||
.button_spacing(space_xxs)
|
||||
.spacing(space_xxs)
|
||||
.on_activate(on_activate)
|
||||
.style(crate::theme::SegmentedButton::ViewSwitcher)
|
||||
.style(crate::theme::SegmentedButton::TabBar)
|
||||
.apply(scrollable)
|
||||
.height(Length::Fill)
|
||||
.apply(container)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ where
|
|||
/ num as f32;
|
||||
}
|
||||
|
||||
let segmented_selection = matches!(self.style, crate::theme::SegmentedButton::Control);
|
||||
let segmetned_control = matches!(self.style, crate::theme::SegmentedButton::Control);
|
||||
|
||||
Box::new(
|
||||
self.model
|
||||
|
|
@ -91,7 +91,7 @@ where
|
|||
let button_bounds = ItemBounds::Button(key, layout_bounds);
|
||||
let mut divider = None;
|
||||
|
||||
if self.dividers && segmented_selection && nth + 1 < num {
|
||||
if self.dividers && segmetned_control && nth + 1 < num {
|
||||
divider = Some(ItemBounds::Divider(Rectangle {
|
||||
width: 1.0,
|
||||
..bounds
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ where
|
|||
segmented_button::horizontal(model)
|
||||
.button_height(44)
|
||||
.button_padding([space_s, space_xs, space_s, space_xs])
|
||||
.style(crate::theme::SegmentedButton::ViewSwitcher)
|
||||
.style(crate::theme::SegmentedButton::TabBar)
|
||||
.font_active(Some(crate::font::FONT_SEMIBOLD))
|
||||
}
|
||||
|
||||
|
|
@ -49,6 +49,6 @@ where
|
|||
SegmentedButton::new(model)
|
||||
.button_height(44)
|
||||
.button_padding([space_s, space_xs, space_s, space_xs])
|
||||
.style(crate::theme::SegmentedButton::ViewSwitcher)
|
||||
.style(crate::theme::SegmentedButton::TabBar)
|
||||
.font_active(Some(crate::font::FONT_SEMIBOLD))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue