toolbar.rs

 1use gpui2::elements::div;
 2use gpui2::style::StyleHelpers;
 3use gpui2::{Element, IntoElement, ParentElement, ViewContext};
 4
 5use crate::{breadcrumb, icon_button, theme};
 6
 7pub struct ToolbarItem {}
 8
 9#[derive(Element)]
10pub struct Toolbar {
11    items: Vec<ToolbarItem>,
12}
13
14pub fn toolbar() -> Toolbar {
15    Toolbar { items: Vec::new() }
16}
17
18impl Toolbar {
19    fn render<V: 'static>(&mut self, _: &mut V, cx: &mut ViewContext<V>) -> impl IntoElement<V> {
20        let theme = theme(cx);
21
22        div()
23            .p_2()
24            .flex()
25            .justify_between()
26            .child(breadcrumb())
27            .child(
28                div()
29                    .flex()
30                    .child(icon_button("icons/inlay_hint.svg"))
31                    .child(icon_button("icons/magnifying_glass.svg"))
32                    .child(icon_button("icons/magic-wand.svg")),
33            )
34    }
35}