tool_divider.rs

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