WIP: Get everything compiling again and keep window open

This commit is contained in:
Nathan Sobo
2021-03-19 12:12:10 -06:00
parent 605bdd62dd
commit cfe3aae2de
10 changed files with 316 additions and 319 deletions
+11 -3
View File
@@ -68,9 +68,9 @@ pub trait UpdateView {
pub struct App(Rc<RefCell<MutableAppContext>>);
impl App {
pub fn test<T, F: Future<Output = T>>(
asset_source: impl AssetSource,
f: impl FnOnce(App) -> F,
pub fn test<T, A: AssetSource, F: Future<Output = T>, G: FnOnce(App) -> F>(
asset_source: A,
f: G,
) -> T {
let platform = platform::current::app(); // TODO: Make a test platform app
let foreground = Rc::new(executor::Foreground::test());
@@ -248,6 +248,14 @@ impl App {
pub fn finish_pending_tasks(&self) -> impl Future<Output = ()> {
self.0.borrow().finish_pending_tasks()
}
pub fn fonts(&self) -> Arc<FontCache> {
self.0.borrow().fonts.clone()
}
pub fn platform(&self) -> Arc<dyn platform::App> {
self.0.borrow().platform.clone()
}
}
impl UpdateModel for App {
+1 -1
View File
@@ -99,7 +99,7 @@ impl Presenter {
// }
// canvas.into_canvas().into_scene()
todo!()
Scene {}
}
pub fn responder_chain(&self, app: &AppContext) -> Option<Vec<usize>> {