tool_divider.rs

 1use std::marker::PhantomData;
 2
 3use crate::prelude::*;
 4
 5#[derive(Element)]
 6pub struct ToolDivider<S: 'static + Send + Sync> {
 7    state_type: PhantomData<S>,
 8}
 9
10impl<S: 'static + Send + Sync> ToolDivider<S> {
11    pub fn new() -> Self {
12        Self {
13            state_type: PhantomData,
14        }
15    }
16
17    fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
18        let color = ThemeColor::new(cx);
19
20        div().w_px().h_3().bg(color.border)
21    }
22}