use super::state::TooltipState;
use super::style::{ChromeTooltipStyle, CrosshairTooltipStyle, DefaultTooltipStyle, TooltipStyle};
use super::theme::{ChromeTooltipTheme, CrosshairTooltipTheme, DefaultTooltipTheme, TooltipTheme};
pub struct TooltipSettings {
pub theme: Box<dyn TooltipTheme>,
pub style: Box<dyn TooltipStyle>,
}
impl Default for TooltipSettings {
fn default() -> Self {
Self {
theme: Box::<DefaultTooltipTheme>::default(),
style: Box::new(DefaultTooltipStyle),
}
}
}
impl TooltipSettings {
pub fn chrome() -> Self {
Self {
theme: Box::new(ChromeTooltipTheme),
style: Box::new(ChromeTooltipStyle),
}
}
pub fn toolbar() -> Self {
Self::chrome()
}
pub fn crosshair() -> Self {
Self {
theme: Box::new(CrosshairTooltipTheme),
style: Box::new(CrosshairTooltipStyle),
}
}
}
pub struct TooltipPreset {
pub settings: TooltipSettings,
pub state: TooltipState,
}
impl TooltipPreset {
pub fn for_chrome() -> Self {
Self { settings: TooltipSettings::chrome(), state: TooltipState::for_chrome() }
}
pub fn for_toolbar() -> Self {
Self { settings: TooltipSettings::toolbar(), state: TooltipState::for_toolbar() }
}
pub fn for_crosshair() -> Self {
Self { settings: TooltipSettings::crosshair(), state: TooltipState::for_crosshair() }
}
}