Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Nathan Sobo
809776f6bc WIP 2024-02-02 14:46:44 -07:00

View file

@ -0,0 +1,32 @@
use gpui::*;
struct Counter {
count: usize,
}
impl Counter {
fn new(cx: &mut WindowContext) -> View<Self> {
cx.new_view(|_cx| Self { count: 0 })
}
}
impl Render for Counter {
fn render(&mut self, _cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {
div()
.size_full()
.flex()
.justify_center()
.items_center()
.text_xl()
.bg(rgb(0x2d004b))
.text_color(rgb(0xffffff))
.child(self.count.to_string())
}
}
fn main() {
App::new().run(|cx: &mut AppContext| {
cx.open_window(WindowOptions::default(), Counter::new);
cx.activate(true);
});
}