Merge branch 'gpui2' into marshall/gpui2-playground
This commit is contained in:
commit
e6c7e57711
39 changed files with 2605 additions and 1041 deletions
|
@ -1,9 +1,13 @@
|
|||
#![allow(dead_code, unused_variables)]
|
||||
|
||||
use gpui3::{Bounds, WindowBounds, WindowOptions};
|
||||
use assets::Assets;
|
||||
use gpui3::{px, size, Bounds, WindowBounds, WindowOptions};
|
||||
use log::LevelFilter;
|
||||
use simplelog::SimpleLogger;
|
||||
use std::sync::Arc;
|
||||
use workspace::workspace;
|
||||
|
||||
mod assets;
|
||||
mod collab_panel;
|
||||
mod theme;
|
||||
mod themes;
|
||||
|
@ -20,15 +24,13 @@ fn main() {
|
|||
|
||||
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
|
||||
|
||||
gpui3::App::production().run(|cx| {
|
||||
let asset_source = Arc::new(Assets);
|
||||
gpui3::App::production(asset_source).run(|cx| {
|
||||
let window = cx.open_window(
|
||||
WindowOptions {
|
||||
bounds: WindowBounds::Fixed(Bounds {
|
||||
size: gpui3::Size {
|
||||
width: 800_f32.into(),
|
||||
height: 600_f32.into(),
|
||||
},
|
||||
..Default::default()
|
||||
origin: Default::default(),
|
||||
size: size(px(800.), px(600.)),
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
|
@ -39,29 +41,6 @@ fn main() {
|
|||
});
|
||||
}
|
||||
|
||||
use rust_embed::RustEmbed;
|
||||
use workspace::workspace;
|
||||
|
||||
#[derive(RustEmbed)]
|
||||
#[folder = "../../assets"]
|
||||
#[include = "themes/**/*"]
|
||||
#[include = "fonts/**/*"]
|
||||
#[include = "icons/**/*"]
|
||||
#[exclude = "*.DS_Store"]
|
||||
pub struct Assets;
|
||||
|
||||
// impl AssetSource for Assets {
|
||||
// fn load(&self, path: &str) -> Result<std::borrow::Cow<[u8]>> {
|
||||
// Self::get(path)
|
||||
// .map(|f| f.data)
|
||||
// .ok_or_else(|| anyhow!("could not find asset at path \"{}\"", path))
|
||||
// }
|
||||
|
||||
// fn list(&self, path: &str) -> Vec<std::borrow::Cow<'static, str>> {
|
||||
// Self::iter().filter(|p| p.starts_with(path)).collect()
|
||||
// }
|
||||
// }
|
||||
|
||||
// fn load_embedded_fonts(platform: &dyn gpui2::Platform) {
|
||||
// let font_paths = Assets.list("fonts");
|
||||
// let mut embedded_fonts = Vec::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue