Files
novem/src/screen/dashboard/screen.rs

42 lines
1.1 KiB
Rust
Raw Normal View History

2026-04-26 16:06:49 +01:00
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)),
)
}
}