#[derive(Debug, Clone)]
pub enum BackgroundFill {
Solid,
Glass {
blur_radius: f64,
},
Texture {
asset_id: &'static str,
},
Transparent,
}
pub trait ToolbarStyle {
fn height(&self) -> f64;
fn width(&self) -> f64;
fn item_size(&self) -> f64;
fn icon_size(&self) -> f64;
fn item_spacing(&self) -> f64;
fn section_gap(&self) -> f64;
fn padding(&self) -> f64;
fn item_radius(&self) -> f64;
fn separator_thickness(&self) -> f64;
fn separator_padding(&self) -> f64;
fn scroll_chevron_size(&self) -> f64;
fn split_chevron_width(&self) -> f64;
fn color_swatch_size(&self) -> f64;
fn color_swatch_border_width(&self) -> f64;
fn font_size(&self) -> f64;
fn font_size_small(&self) -> f64;
fn background_fill(&self) -> BackgroundFill {
BackgroundFill::Solid
}
fn show_edge_border(&self) -> bool { false }
}
#[derive(Default)]
pub struct HorizontalToolbarStyle;
impl ToolbarStyle for HorizontalToolbarStyle {
fn height(&self) -> f64 { 32.0 }
fn width(&self) -> f64 { 40.0 }
fn item_size(&self) -> f64 { 28.0 }
fn icon_size(&self) -> f64 { 16.0 }
fn item_spacing(&self) -> f64 { 2.0 }
fn section_gap(&self) -> f64 { 4.0 }
fn padding(&self) -> f64 { 4.0 }
fn item_radius(&self) -> f64 { 2.0 }
fn separator_thickness(&self) -> f64 { 1.0 }
fn separator_padding(&self) -> f64 { 4.0 }
fn scroll_chevron_size(&self) -> f64 { 20.0 }
fn split_chevron_width(&self) -> f64 { 12.0 }
fn color_swatch_size(&self) -> f64 { 16.0 }
fn color_swatch_border_width(&self) -> f64 { 1.0 }
fn font_size(&self) -> f64 { 12.0 }
fn font_size_small(&self) -> f64 { 11.0 }
}
#[derive(Default)]
pub struct VerticalToolbarStyle;
impl ToolbarStyle for VerticalToolbarStyle {
fn height(&self) -> f64 { 32.0 }
fn width(&self) -> f64 { 40.0 }
fn item_size(&self) -> f64 { 32.0 }
fn icon_size(&self) -> f64 { 18.0 }
fn item_spacing(&self) -> f64 { 2.0 }
fn section_gap(&self) -> f64 { 4.0 }
fn padding(&self) -> f64 { 4.0 }
fn item_radius(&self) -> f64 { 4.0 }
fn separator_thickness(&self) -> f64 { 1.0 }
fn separator_padding(&self) -> f64 { 8.0 }
fn scroll_chevron_size(&self) -> f64 { 20.0 }
fn split_chevron_width(&self) -> f64 { 12.0 }
fn color_swatch_size(&self) -> f64 { 18.0 }
fn color_swatch_border_width(&self) -> f64 { 1.0 }
fn font_size(&self) -> f64 { 12.0 }
fn font_size_small(&self) -> f64 { 11.0 }
}
#[derive(Default)]
pub struct ChromeStripStyle;
impl ToolbarStyle for ChromeStripStyle {
fn height(&self) -> f64 { 32.0 }
fn width(&self) -> f64 { 40.0 }
fn item_size(&self) -> f64 { 28.0 }
fn icon_size(&self) -> f64 { 16.0 }
fn item_spacing(&self) -> f64 { 2.0 }
fn section_gap(&self) -> f64 { 8.0 }
fn padding(&self) -> f64 { 4.0 }
fn item_radius(&self) -> f64 { 2.0 }
fn separator_thickness(&self) -> f64 { 1.0 }
fn separator_padding(&self) -> f64 { 4.0 }
fn scroll_chevron_size(&self) -> f64 { 20.0 }
fn split_chevron_width(&self) -> f64 { 12.0 }
fn color_swatch_size(&self) -> f64 { 16.0 }
fn color_swatch_border_width(&self) -> f64 { 1.0 }
fn font_size(&self) -> f64 { 12.0 }
fn font_size_small(&self) -> f64 { 11.0 }
fn background_fill(&self) -> BackgroundFill { BackgroundFill::Transparent }
}
#[derive(Default)]
pub struct InlineToolbarStyle;
impl ToolbarStyle for InlineToolbarStyle {
fn height(&self) -> f64 { 24.0 }
fn width(&self) -> f64 { 32.0 }
fn item_size(&self) -> f64 { 20.0 }
fn icon_size(&self) -> f64 { 14.0 }
fn item_spacing(&self) -> f64 { 1.0 }
fn section_gap(&self) -> f64 { 2.0 }
fn padding(&self) -> f64 { 2.0 }
fn item_radius(&self) -> f64 { 2.0 }
fn separator_thickness(&self) -> f64 { 1.0 }
fn separator_padding(&self) -> f64 { 2.0 }
fn scroll_chevron_size(&self) -> f64 { 16.0 }
fn split_chevron_width(&self) -> f64 { 10.0 }
fn color_swatch_size(&self) -> f64 { 14.0 }
fn color_swatch_border_width(&self) -> f64 { 1.0 }
fn font_size(&self) -> f64 { 11.0 }
fn font_size_small(&self) -> f64 { 10.0 }
fn background_fill(&self) -> BackgroundFill { BackgroundFill::Transparent }
}
pub type DefaultToolbarStyle = HorizontalToolbarStyle;