diff --git a/src/app.rs b/src/app.rs index bbc7045..883f3b2 100644 --- a/src/app.rs +++ b/src/app.rs @@ -3,11 +3,13 @@ use gpui::prelude::*; use crate::models::{FilterState, ProjectTree}; use crate::theme::ActiveTheme; use crate::view::sidebar::{Sidebar, TagItem}; +use crate::view::status_bar::StatusBar; use gpui::div; pub(crate) struct App { sidebar: gpui::Entity, filter_state: gpui::Entity, + status_bar: gpui::Entity, } impl gpui::Render for App { @@ -18,10 +20,9 @@ impl gpui::Render for App { ) -> impl gpui::IntoElement { let theme = _cx.theme(); - div() + let content = div() .flex() - .size_full() - .bg(theme.background) + .flex_1() .child(div().w(gpui::px(250.)).h_full().child(self.sidebar.clone())) .child( div() @@ -35,7 +36,15 @@ impl gpui::Render for App { .text_color(theme.muted) .child("Main panel - TaskTable will go here"), ), - ) + ); + + div() + .flex() + .flex_col() + .size_full() + .bg(theme.background) + .child(content) + .child(self.status_bar.clone()) } } @@ -89,6 +98,8 @@ impl App { }, ]; + let status_bar = cx.new(|cx| StatusBar::new(cx)); + let sidebar = cx.new(|cx| { Sidebar::new(project_tree, tags, filter_state.clone(), cx) .on_filter_change(|filter, _window, _cx| { @@ -105,6 +116,7 @@ impl App { App { sidebar, filter_state, + status_bar, } }) }, diff --git a/src/view/mod.rs b/src/view/mod.rs index e16f8da..4946380 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -1 +1,2 @@ pub mod sidebar; +pub mod status_bar; diff --git a/src/view/status_bar.rs b/src/view/status_bar.rs new file mode 100644 index 0000000..a6b0949 --- /dev/null +++ b/src/view/status_bar.rs @@ -0,0 +1,31 @@ +use gpui::{Context, IntoElement, Render, Window, div, prelude::*, px}; + +use crate::theme::ActiveTheme; + +pub struct StatusBar { + // TODO: Add vim_mode, sync_state, last_sync, etc. +} + +impl StatusBar { + pub fn new(_cx: &mut Context) -> Self { + Self {} + } +} + +impl Render for StatusBar { + fn render(&mut self, _window: &mut Window, cx: &mut Context) -> impl IntoElement { + let theme = cx.theme().clone(); + + div() + .flex() + .items_center() + .justify_between() + .w_full() + .h(px(30.0)) + .px_4() + .py_1() + .bg(theme.panel) + .border_b_1() + .border_color(theme.border) + } +}