This PR scaffolds the `Toolbar` and `Breadcrumb` components. Right now they both just consist of hardcoded data. <img width="846" alt="Screenshot 2023-09-22 at 4 54 00 PM" src="https://github.com/zed-industries/zed/assets/1486634/70578df2-7216-42d2-97ef-d38b83fb4a25"> <img width="799" alt="Screenshot 2023-09-22 at 4 46 04 PM" src="https://github.com/zed-industries/zed/assets/1486634/73ca3d8a-baf9-4ed4-b4c4-279c674672a3"> Release Notes: - N/A
57 lines
1.9 KiB
Rust
57 lines
1.9 KiB
Rust
use gpui2::{
|
|
elements::{div, div::ScrollState},
|
|
style::StyleHelpers,
|
|
Element, IntoElement, ParentElement, ViewContext,
|
|
};
|
|
use ui::{chat_panel, project_panel, status_bar, tab_bar, theme, title_bar, toolbar};
|
|
|
|
#[derive(Element, Default)]
|
|
pub struct WorkspaceElement {
|
|
left_scroll_state: ScrollState,
|
|
right_scroll_state: ScrollState,
|
|
tab_bar_scroll_state: ScrollState,
|
|
}
|
|
|
|
impl WorkspaceElement {
|
|
fn render<V: 'static>(&mut self, _: &mut V, cx: &mut ViewContext<V>) -> impl IntoElement<V> {
|
|
let theme = theme(cx);
|
|
|
|
div()
|
|
.size_full()
|
|
.flex()
|
|
.flex_col()
|
|
.font("Zed Sans Extended")
|
|
.gap_0()
|
|
.justify_start()
|
|
.items_start()
|
|
.text_color(theme.lowest.base.default.foreground)
|
|
.fill(theme.lowest.base.default.background)
|
|
.child(title_bar())
|
|
.child(
|
|
div()
|
|
.flex_1()
|
|
.w_full()
|
|
.flex()
|
|
.flex_row()
|
|
.overflow_hidden()
|
|
.child(project_panel(self.left_scroll_state.clone()))
|
|
.child(
|
|
div()
|
|
.h_full()
|
|
.flex_1()
|
|
.fill(theme.highest.base.default.background)
|
|
.child(
|
|
div()
|
|
.flex()
|
|
.flex_col()
|
|
.flex_1()
|
|
.child(tab_bar(self.tab_bar_scroll_state.clone()))
|
|
.child(toolbar()),
|
|
),
|
|
)
|
|
.child(chat_panel(self.right_scroll_state.clone())),
|
|
)
|
|
.child(status_bar())
|
|
}
|
|
}
|