Checkpoint

This commit is contained in:
Nathan Sobo 2023-08-22 09:07:45 -06:00
parent ff7b25c538
commit 53679ce045
8 changed files with 228 additions and 263 deletions

View file

@ -1,8 +1,14 @@
#![allow(dead_code, unused_variables)]
use crate::{color::black, style::StyleHelpers};
use element::Element;
use gpui::{
geometry::{rect::RectF, vector::vec2f},
platform::WindowOptions,
};
use log::LevelFilter;
use simplelog::SimpleLogger;
use themes::ThemeColors;
use themes::{rose_pine, ThemeColors};
use view::view;
mod adapter;
mod color;
@ -21,32 +27,33 @@ fn main() {
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
gpui::App::new(()).unwrap().run(|cx| {
// cx.add_window(
// WindowOptions {
// bounds: gpui::platform::WindowBounds::Fixed(RectF::new(
// vec2f(0., 0.),
// vec2f(400., 300.),
// )),
// center: true,
// ..Default::default()
// },
// |_| view(|_| playground(&rose_pine::moon())),
// );
cx.add_window(
WindowOptions {
bounds: gpui::platform::WindowBounds::Fixed(RectF::new(
vec2f(0., 0.),
vec2f(400., 300.),
)),
center: true,
..Default::default()
},
|_| view(|_| playground(&rose_pine::moon())),
);
cx.platform().activate(true);
});
}
// fn playground<V: 'static>(theme: &ThemeColors) -> impl Element<V> {
// todo!()
// // frame()
// // .text_color(black())
// // .h_full()
// // .w_half()
// // .fill(theme.success(0.5))
// // .hover()
// // .fill(theme.error(0.5))
// // .child(button().label("Hello").click(|_, _, _| println!("click!")))
// }
fn playground<V: 'static>(theme: &ThemeColors) -> impl Element<V> {
use div::div;
div()
.text_color(black())
.h_full()
.w_24()
.fill(theme.success(0.5))
// .hover()
// .fill(theme.error(0.5))
// .child(button().label("Hello").click(|_, _, _| println!("click!")))
}
// todo!()
// // column()