tool_divider.rs

 1use crate::prelude::*;
 2use gpui::{Div, RenderOnce};
 3
 4#[derive(RenderOnce)]
 5pub struct ToolDivider;
 6
 7impl<V: 'static> Component<V> for ToolDivider {
 8    type Rendered = Div<V>;
 9
10    fn render(self, view: &mut V, cx: &mut ViewContext<V>) -> Self::Rendered {
11        div().w_px().h_3().bg(cx.theme().colors().border)
12    }
13}
14
15impl ToolDivider {
16    pub fn new() -> Self {
17        Self
18    }
19
20    fn render<V: 'static>(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Element<V> {
21        div().w_px().h_3().bg(cx.theme().colors().border)
22    }
23}