feat: Add empty StatusBar component
- Create StatusBar component with 30px fixed height - Position at bottom of app layout with proper flex column structure - Add placeholders for vim mode (left) and sync status (right) - Reorganize App layout to accommodate status bar below main content
This commit is contained in:
+16
-4
@@ -3,11 +3,13 @@ use gpui::prelude::*;
|
|||||||
use crate::models::{FilterState, ProjectTree};
|
use crate::models::{FilterState, ProjectTree};
|
||||||
use crate::theme::ActiveTheme;
|
use crate::theme::ActiveTheme;
|
||||||
use crate::view::sidebar::{Sidebar, TagItem};
|
use crate::view::sidebar::{Sidebar, TagItem};
|
||||||
|
use crate::view::status_bar::StatusBar;
|
||||||
use gpui::div;
|
use gpui::div;
|
||||||
|
|
||||||
pub(crate) struct App {
|
pub(crate) struct App {
|
||||||
sidebar: gpui::Entity<Sidebar>,
|
sidebar: gpui::Entity<Sidebar>,
|
||||||
filter_state: gpui::Entity<FilterState>,
|
filter_state: gpui::Entity<FilterState>,
|
||||||
|
status_bar: gpui::Entity<StatusBar>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl gpui::Render for App {
|
impl gpui::Render for App {
|
||||||
@@ -18,10 +20,9 @@ impl gpui::Render for App {
|
|||||||
) -> impl gpui::IntoElement {
|
) -> impl gpui::IntoElement {
|
||||||
let theme = _cx.theme();
|
let theme = _cx.theme();
|
||||||
|
|
||||||
div()
|
let content = div()
|
||||||
.flex()
|
.flex()
|
||||||
.size_full()
|
.flex_1()
|
||||||
.bg(theme.background)
|
|
||||||
.child(div().w(gpui::px(250.)).h_full().child(self.sidebar.clone()))
|
.child(div().w(gpui::px(250.)).h_full().child(self.sidebar.clone()))
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
@@ -35,7 +36,15 @@ impl gpui::Render for App {
|
|||||||
.text_color(theme.muted)
|
.text_color(theme.muted)
|
||||||
.child("Main panel - TaskTable will go here"),
|
.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| {
|
let sidebar = cx.new(|cx| {
|
||||||
Sidebar::new(project_tree, tags, filter_state.clone(), cx)
|
Sidebar::new(project_tree, tags, filter_state.clone(), cx)
|
||||||
.on_filter_change(|filter, _window, _cx| {
|
.on_filter_change(|filter, _window, _cx| {
|
||||||
@@ -105,6 +116,7 @@ impl App {
|
|||||||
App {
|
App {
|
||||||
sidebar,
|
sidebar,
|
||||||
filter_state,
|
filter_state,
|
||||||
|
status_bar,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
pub mod sidebar;
|
pub mod sidebar;
|
||||||
|
pub mod status_bar;
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
Self {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Render for StatusBar {
|
||||||
|
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> 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)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user