use mitsuami_core::{Element, ElementBuilder, NodeId, Orientation, Prop, Tweak, Ui, View, WidgetKind};
use mitsuami_reactive::{IntoValue, Value};
pub struct Separator(Element);
widget!(Separator);
impl Separator {
pub fn new() -> Separator {
let mut element = Element::new(WidgetKind::Separator);
element.prop(Value::Static(Orientation::Horizontal), Prop::Orientation);
Separator(element)
}
pub fn vertical() -> Separator {
Separator::new().orientation(Orientation::Vertical)
}
pub fn orientation(mut self, orientation: impl IntoValue<Orientation>) -> Separator {
self.0.prop(orientation.into_value(), Prop::Orientation);
self
}
pub fn native(mut self, tweak: Tweak<Separator>) -> Separator {
tweak.apply(&mut self.0);
self
}
}
impl Default for Separator {
fn default() -> Separator {
Separator::new()
}
}
impl Separator {
#[doc(hidden)]
pub fn __tag() -> Separator {
Separator::new()
}
}