toolbar.rs

 1use gpui2::elements::div;
 2use gpui2::style::StyleHelpers;
 3use gpui2::{Element, IntoElement, ParentElement, ViewContext};
 4
 5use crate::{breadcrumb, theme, IconAsset, IconButton};
 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(IconButton::new(IconAsset::InlayHint))
31                    .child(IconButton::new(IconAsset::MagnifyingGlass))
32                    .child(IconButton::new(IconAsset::MagicWand)),
33            )
34    }
35}