#[derive(Debug, Clone)]
pub enum BackgroundFill {
Solid,
Glass {
blur_radius: f64,
},
}
pub trait SidebarStyle {
fn header_height(&self) -> f64;
fn tab_strip_height(&self) -> f64;
fn padding(&self) -> f64;
fn resize_zone_width(&self) -> f64;
fn border_width(&self) -> f64;
fn min_width(&self) -> f64;
fn max_width(&self) -> f64;
fn default_width(&self) -> f64;
fn scrollbar_width(&self) -> f64;
fn background_fill(&self) -> BackgroundFill {
BackgroundFill::Solid
}
}
#[derive(Default)]
pub struct DefaultSidebarStyle;
impl SidebarStyle for DefaultSidebarStyle {
fn header_height(&self) -> f64 { 40.0 }
fn tab_strip_height(&self) -> f64 { 32.0 }
fn padding(&self) -> f64 { 12.0 }
fn resize_zone_width(&self) -> f64 { 8.0 }
fn border_width(&self) -> f64 { 1.0 }
fn min_width(&self) -> f64 { 280.0 }
fn max_width(&self) -> f64 { 4000.0 }
fn default_width(&self) -> f64 { 340.0 }
fn scrollbar_width(&self) -> f64 { 8.0 }
}
pub type RightSidebarStyle = DefaultSidebarStyle;
pub type LeftSidebarStyle = DefaultSidebarStyle;
#[derive(Default)]
pub struct WithTypeSelectorStyle;
impl SidebarStyle for WithTypeSelectorStyle {
fn header_height(&self) -> f64 { 40.0 }
fn tab_strip_height(&self) -> f64 { 32.0 }
fn padding(&self) -> f64 { 12.0 }
fn resize_zone_width(&self) -> f64 { 8.0 }
fn border_width(&self) -> f64 { 1.0 }
fn min_width(&self) -> f64 { 280.0 }
fn max_width(&self) -> f64 { 4000.0 }
fn default_width(&self) -> f64 { 340.0 }
fn scrollbar_width(&self) -> f64 { 8.0 }
}
#[derive(Default)]
pub struct EmbeddedSidebarStyle;
impl SidebarStyle for EmbeddedSidebarStyle {
fn header_height(&self) -> f64 { 40.0 }
fn tab_strip_height(&self) -> f64 { 32.0 }
fn padding(&self) -> f64 { 12.0 }
fn resize_zone_width(&self) -> f64 { 0.0 }
fn border_width(&self) -> f64 { 0.0 }
fn min_width(&self) -> f64 { 280.0 }
fn max_width(&self) -> f64 { 4000.0 }
fn default_width(&self) -> f64 { 280.0 }
fn scrollbar_width(&self) -> f64 { 8.0 }
}