vizia_core 0.4.0

Core components of vizia
use crate::prelude::*;

/// The Divider view provides a thin, unobtrusive line for visually separating views.
pub struct Divider {}

impl Divider {
    /// Creates a dividing line. Orientation is determined by context.
    pub fn new(cx: &mut Context) -> Handle<Self> {
        Self {}.build(cx, |cx| {
            Element::new(cx).class("divider-line");
        })
    }

    /// Creates a horizontal dividing line.
    pub fn horizontal(cx: &mut Context) -> Handle<Self> {
        Self::new(cx).class("horizontal")
    }

    /// Creates a vertical dividing line.
    pub fn vertical(cx: &mut Context) -> Handle<Self> {
        Self::new(cx).class("vertical")
    }
}

impl View for Divider {
    fn element(&self) -> Option<&'static str> {
        Some("divider")
    }
}

impl Handle<'_, Divider> {}