initial commit
This commit is contained in:
48
src/dashboard.rs
Normal file
48
src/dashboard.rs
Normal file
@@ -0,0 +1,48 @@
|
||||
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)),
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user