pub trait TooltipStyle {
fn radius(&self) -> f64;
fn padding_x(&self) -> f64;
fn padding_y(&self) -> f64;
fn font_size(&self) -> f64;
fn border_width(&self) -> f64;
fn anchor_gap(&self) -> f64;
fn fade_duration_ms(&self) -> f64;
fn has_shadow(&self) -> bool { false }
fn auto_flip(&self) -> bool { false }
fn multi_line(&self) -> bool { false }
fn min_content_width(&self) -> f64 { 0.0 }
fn line_height_factor(&self) -> f64 { 1.4 }
}
pub struct DefaultTooltipStyle;
impl Default for DefaultTooltipStyle {
fn default() -> Self {
Self
}
}
impl TooltipStyle for DefaultTooltipStyle {
fn radius(&self) -> f64 { 4.0 }
fn padding_x(&self) -> f64 { 8.0 }
fn padding_y(&self) -> f64 { 4.0 }
fn font_size(&self) -> f64 { 12.0 }
fn border_width(&self) -> f64 { 1.0 }
fn anchor_gap(&self) -> f64 { 6.0 }
fn fade_duration_ms(&self) -> f64 { 150.0 }
}
pub struct ChromeTooltipStyle;
impl Default for ChromeTooltipStyle {
fn default() -> Self { Self }
}
impl TooltipStyle for ChromeTooltipStyle {
fn radius(&self) -> f64 { 4.0 }
fn padding_x(&self) -> f64 { 6.0 }
fn padding_y(&self) -> f64 { 6.0 }
fn font_size(&self) -> f64 { 12.0 }
fn border_width(&self) -> f64 { 0.0 }
fn anchor_gap(&self) -> f64 { 20.0 }
fn fade_duration_ms(&self) -> f64 { 150.0 }
fn has_shadow(&self) -> bool { true }
fn auto_flip(&self) -> bool { true }
fn multi_line(&self) -> bool { false }
}
pub struct CrosshairTooltipStyle;
impl Default for CrosshairTooltipStyle {
fn default() -> Self { Self }
}
impl TooltipStyle for CrosshairTooltipStyle {
fn radius(&self) -> f64 { 4.0 }
fn padding_x(&self) -> f64 { 8.0 }
fn padding_y(&self) -> f64 { 8.0 }
fn font_size(&self) -> f64 { 11.0 }
fn border_width(&self) -> f64 { 1.0 }
fn anchor_gap(&self) -> f64 { 10.0 }
fn fade_duration_ms(&self) -> f64 { 0.0 }
fn has_shadow(&self) -> bool { false }
fn auto_flip(&self) -> bool { false }
fn multi_line(&self) -> bool { true }
fn min_content_width(&self) -> f64 { 80.0 }
fn line_height_factor(&self) -> f64 { 1.4 }
}