use super::ViewStyle;
use crate::geometry::{ByEdge, Dimension};
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum ScrollbarColor {
Auto,
Dark,
Light,
}
impl Default for ScrollbarColor {
fn default() -> Self {
ScrollbarColor::Auto
}
}
#[derive(Copy, Clone, Debug, Default, PartialEq)]
pub struct ScrollableStyle {
pub scroll_padding: ByEdge<Dimension<f32>>,
pub scrollbar_color: ScrollbarColor,
pub scrollbar_padding: ByEdge<Dimension<f32>>,
}
#[derive(Copy, Clone, Debug, Default, PartialEq)]
pub struct ScrollableViewStyle {
pub scrollable: ScrollableStyle,
pub view: ViewStyle,
}
impl From<ScrollableStyle> for ScrollableViewStyle {
fn from(style: ScrollableStyle) -> Self {
ScrollableViewStyle {
scrollable: style,
..Default::default()
}
}
}
impl From<ViewStyle> for ScrollableViewStyle {
fn from(style: ViewStyle) -> Self {
ScrollableViewStyle {
view: style,
..Default::default()
}
}
}