Restore auto-save on focus change, re-enable workspace tests

This commit is contained in:
Max Brunsfeld 2023-11-30 14:44:26 -08:00
parent c63ca09eed
commit a003a91212
13 changed files with 1350 additions and 1304 deletions

View file

@ -11,11 +11,11 @@ use std::{
};
#[derive(Default)]
struct Handlers {
active_status_change: Vec<Box<dyn FnMut(bool)>>,
input: Vec<Box<dyn FnMut(crate::InputEvent) -> bool>>,
moved: Vec<Box<dyn FnMut()>>,
resize: Vec<Box<dyn FnMut(Size<Pixels>, f32)>>,
pub(crate) struct TestWindowHandlers {
pub(crate) active_status_change: Vec<Box<dyn FnMut(bool)>>,
pub(crate) input: Vec<Box<dyn FnMut(crate::InputEvent) -> bool>>,
pub(crate) moved: Vec<Box<dyn FnMut()>>,
pub(crate) resize: Vec<Box<dyn FnMut(Size<Pixels>, f32)>>,
}
pub struct TestWindow {
@ -23,7 +23,7 @@ pub struct TestWindow {
current_scene: Mutex<Option<Scene>>,
display: Rc<dyn PlatformDisplay>,
pub(crate) input_handler: Option<Arc<Mutex<Box<dyn PlatformInputHandler>>>>,
handlers: Mutex<Handlers>,
pub(crate) handlers: Arc<Mutex<TestWindowHandlers>>,
platform: Weak<TestPlatform>,
sprite_atlas: Arc<dyn PlatformAtlas>,
}
@ -167,6 +167,10 @@ impl PlatformWindow for TestWindow {
fn sprite_atlas(&self) -> sync::Arc<dyn crate::PlatformAtlas> {
self.sprite_atlas.clone()
}
fn as_test(&self) -> Option<&TestWindow> {
Some(self)
}
}
pub struct TestAtlasState {