breadcrumb.rs

 1use gpui2::elements::div;
 2use gpui2::style::{StyleHelpers, Styleable};
 3use gpui2::{Element, IntoElement, ParentElement, ViewContext};
 4
 5use crate::theme;
 6
 7#[derive(Element)]
 8pub struct Breadcrumb {}
 9
10pub fn breadcrumb() -> Breadcrumb {
11    Breadcrumb {}
12}
13
14impl Breadcrumb {
15    fn render<V: 'static>(&mut self, _: &mut V, cx: &mut ViewContext<V>) -> impl IntoElement<V> {
16        let theme = theme(cx);
17
18        div()
19            .px_1()
20            .flex()
21            .flex_row()
22            // TODO: Read font from theme (or settings?).
23            .font("Zed Mono Extended")
24            .text_sm()
25            .text_color(theme.middle.base.default.foreground)
26            .rounded_md()
27            .hover()
28            .fill(theme.highest.base.hovered.background)
29            // TODO: Replace hardcoded breadcrumbs.
30            .child("crates/ui/src/components/toolbar.rs")
31            .child("")
32            .child("impl Breadcrumb")
33            .child("")
34            .child("fn render")
35    }
36}