breadcrumb.rs

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