Files
novem/src/dashboard.rs

49 lines
1.4 KiB
Rust
Raw Normal View History

2026-04-20 15:13:26 +01:00
use gpui::{div, prelude::*};
use crate::theme::Variant;
pub struct Screen {
pub text: gpui::SharedString,
}
impl Render for Screen {
fn render(
&mut self,
_window: &mut gpui::Window,
_cx: &mut gpui::Context<Self>,
) -> impl IntoElement {
let builtin = Variant::VioletDark;
let theme = builtin.theme();
div()
.flex()
.flex_col()
.size_full()
.gap_3()
.bg(theme.colors.background)
.justify_center()
.items_center()
.shadow_lg()
.text_xl()
.text_color(theme.colors.text)
.child(format!("Hello, {}!", &self.text))
.child(
div()
.text_sm()
.text_color(theme.colors.text_muted)
.child(format!("Built-in theme: {}", builtin.label())),
)
.child(
div()
.flex()
.gap_2()
.child(div().size_8().bg(theme.colors.surface))
.child(div().size_8().bg(theme.colors.surface_elevated))
.child(div().size_8().bg(theme.colors.accent))
.child(div().size_8().bg(theme.colors.success))
.child(div().size_8().bg(theme.colors.warning))
.child(div().size_8().bg(theme.colors.danger)),
)
}
}