feat: dashboard skeleton
This commit is contained in:
41
src/screen/dashboard/screen.rs
Normal file
41
src/screen/dashboard/screen.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
use gpui::{AppContext, ParentElement, Styled, div};
|
||||
|
||||
use crate::{app, screen::dashboard::titlebar};
|
||||
|
||||
pub(crate) struct Screen {
|
||||
titlebar: gpui::Entity<titlebar::TitleBar>,
|
||||
}
|
||||
|
||||
pub(crate) fn new(cx: &mut gpui::App) -> Screen {
|
||||
Screen {
|
||||
titlebar: cx.new(|cx| titlebar::new(cx)),
|
||||
}
|
||||
}
|
||||
|
||||
impl gpui::Render for Screen {
|
||||
fn render(
|
||||
&mut self,
|
||||
_window: &mut gpui::Window,
|
||||
cx: &mut gpui::Context<Self>,
|
||||
) -> impl gpui::IntoElement {
|
||||
let theme = app::current_theme(cx);
|
||||
div()
|
||||
.flex()
|
||||
.flex_col()
|
||||
.bg(theme.colors.background)
|
||||
.size_full()
|
||||
.child(self.titlebar.clone())
|
||||
.child(
|
||||
div()
|
||||
.flex()
|
||||
.flex_row()
|
||||
.flex_1()
|
||||
.w_full()
|
||||
.gap_2()
|
||||
.px_3()
|
||||
.pb_3()
|
||||
.child(div().w_1_4().h_full().rounded_lg().bg(theme.colors.surface))
|
||||
.child(div().w_3_4().h_full().rounded_lg().bg(theme.colors.surface)),
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user