diff --git a/crates/gpui3/src/view.rs b/crates/gpui3/src/view.rs index e8aaf2357a..b4a4001692 100644 --- a/crates/gpui3/src/view.rs +++ b/crates/gpui3/src/view.rs @@ -62,7 +62,7 @@ impl Element for View { fn paint( &mut self, - layout: Layout, + _: Layout, _: &mut Self::State, element: &mut Self::FrameState, cx: &mut ViewContext, @@ -92,12 +92,7 @@ impl ViewObject for View { }) } - fn paint( - &mut self, - layout: Layout, - element: &mut dyn Any, - cx: &mut WindowContext, - ) -> Result<()> { + fn paint(&mut self, _: Layout, element: &mut dyn Any, cx: &mut WindowContext) -> Result<()> { self.state.update(cx, |state, cx| { element .downcast_mut::>() diff --git a/crates/gpui3/src/window.rs b/crates/gpui3/src/window.rs index d264a2f150..7c2416b146 100644 --- a/crates/gpui3/src/window.rs +++ b/crates/gpui3/src/window.rs @@ -89,12 +89,12 @@ impl<'a, 'w> WindowContext<'a, 'w> { } } - pub(crate) fn immutable(app: &'a AppContext, window: &'w Window) -> Self { - Self { - app: Reference::Immutable(app), - window: Reference::Immutable(window), - } - } + // pub(crate) fn immutable(app: &'a AppContext, window: &'w Window) -> Self { + // Self { + // app: Reference::Immutable(app), + // window: Reference::Immutable(window), + // } + // } pub(crate) fn draw(&mut self) -> Result<()> { let unit_entity = self.unit_entity.clone(); @@ -204,18 +204,6 @@ impl<'a, 'w> WindowContext<'a, 'w> { pub fn mouse_position(&self) -> Point { self.window.mouse_position } - - fn update_window( - &mut self, - window_handle: AnyWindowHandle, - update: impl FnOnce(&mut WindowContext) -> R, - ) -> Result { - if window_handle == self.window.handle { - Ok(update(self)) - } else { - self.app.update_window(window_handle.id, update) - } - } } impl Context for WindowContext<'_, '_> { @@ -280,19 +268,6 @@ pub struct ViewContext<'a, 'w, T> { } impl<'a, 'w, T: Send + Sync + 'static> ViewContext<'a, 'w, T> { - // fn update(&mut self, update: impl FnOnce(&mut T, &mut Self) -> R) -> R { - - // self.window_cx.update_entity(handle, update) - - // let mut entity = self.window_cx.app.entities.remove(&self.entity_id).unwrap(); - // let result = update(entity.downcast_mut::().unwrap(), self); - // self.window_cx - // .app - // .entities - // .insert(self.entity_id, Box::new(entity)); - // result - // } - fn mutable(app: &'a mut AppContext, window: &'w mut Window, entity_id: EntityId) -> Self { Self { window_cx: WindowContext::mutable(app, window), @@ -301,13 +276,13 @@ impl<'a, 'w, T: Send + Sync + 'static> ViewContext<'a, 'w, T> { } } - fn immutable(app: &'a AppContext, window: &'w Window, entity_id: EntityId) -> Self { - Self { - window_cx: WindowContext::immutable(app, window), - entity_id, - entity_type: PhantomData, - } - } + // fn immutable(app: &'a AppContext, window: &'w Window, entity_id: EntityId) -> Self { + // Self { + // window_cx: WindowContext::immutable(app, window), + // entity_id, + // entity_type: PhantomData, + // } + // } pub fn erase_state(&mut self, f: impl FnOnce(&mut ViewContext<()>) -> R) -> R { let entity_id = self.unit_entity.id; diff --git a/crates/storybook2/src/workspace.rs b/crates/storybook2/src/workspace.rs index cd1be7a5e4..c614af490d 100644 --- a/crates/storybook2/src/workspace.rs +++ b/crates/storybook2/src/workspace.rs @@ -291,7 +291,6 @@ impl Titlebar { // ================================================================================ // mod statusbar { - use gpui3::WindowContext; use super::*;