Re-introduce active path tracking in workspace
This commit is contained in:
@@ -502,6 +502,19 @@ impl<'a> VisualTestContext<'a> {
|
||||
self.cx.dispatch_action(self.window, action)
|
||||
}
|
||||
|
||||
pub fn window_title(&mut self) -> Option<String> {
|
||||
self.cx
|
||||
.update_window(self.window, |_, cx| {
|
||||
cx.window
|
||||
.platform_window
|
||||
.as_test()
|
||||
.unwrap()
|
||||
.window_title
|
||||
.clone()
|
||||
})
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
pub fn simulate_keystrokes(&mut self, keystrokes: &str) {
|
||||
self.cx.simulate_keystrokes(self.window, keystrokes)
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ pub struct TestWindow {
|
||||
bounds: WindowBounds,
|
||||
current_scene: Mutex<Option<Scene>>,
|
||||
display: Rc<dyn PlatformDisplay>,
|
||||
pub(crate) window_title: Option<String>,
|
||||
pub(crate) input_handler: Option<Arc<Mutex<Box<dyn PlatformInputHandler>>>>,
|
||||
pub(crate) handlers: Arc<Mutex<TestWindowHandlers>>,
|
||||
platform: Weak<TestPlatform>,
|
||||
@@ -42,6 +43,7 @@ impl TestWindow {
|
||||
input_handler: None,
|
||||
sprite_atlas: Arc::new(TestAtlas::new()),
|
||||
handlers: Default::default(),
|
||||
window_title: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,8 +102,8 @@ impl PlatformWindow for TestWindow {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn set_title(&mut self, _title: &str) {
|
||||
todo!()
|
||||
fn set_title(&mut self, title: &str) {
|
||||
self.window_title = Some(title.to_owned());
|
||||
}
|
||||
|
||||
fn set_edited(&mut self, _edited: bool) {
|
||||
|
||||
@@ -678,6 +678,10 @@ impl<'a> WindowContext<'a> {
|
||||
self.window.platform_window.zoom();
|
||||
}
|
||||
|
||||
pub fn set_window_title(&mut self, title: &str) {
|
||||
self.window.platform_window.set_title(title);
|
||||
}
|
||||
|
||||
pub fn display(&self) -> Option<Rc<dyn PlatformDisplay>> {
|
||||
self.platform
|
||||
.displays()
|
||||
|
||||
Reference in New Issue
Block a user