refactor!(widget): rename view_switcher to tab_bar to match Figma docs

This commit is contained in:
Michael Aaron Murphy 2024-02-26 16:26:33 +01:00 committed by Michael Murphy
parent bfc84c4759
commit ff9438c5ba
5 changed files with 14 additions and 16 deletions

View file

@ -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::*;

View file

@ -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)

View file

@ -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

View file

@ -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))
}