mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-11 21:00:35 +00:00
Remove unused Interactive
impl for FakeSettings
This commit is contained in:
parent
2bbce2f0fd
commit
d91b423a45
1 changed files with 1 additions and 32 deletions
|
@ -1,9 +1,7 @@
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use gpui3::{
|
use gpui3::{
|
||||||
rems, AbsoluteLength, AnyElement, BorrowAppContext, Bounds, Interactive, LayoutId, Pixels,
|
rems, AbsoluteLength, AnyElement, BorrowAppContext, Bounds, LayoutId, Pixels, WindowContext,
|
||||||
WindowContext,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
@ -149,32 +147,3 @@ impl<E: Element> Element for WithSettings<E> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<E: Element + Interactive> Interactive for WithSettings<E> {
|
|
||||||
fn listeners(&mut self) -> &mut gpui3::EventListeners<Self::ViewState> {
|
|
||||||
self.child.listeners()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn on_mouse_down(
|
|
||||||
mut self,
|
|
||||||
button: gpui3::MouseButton,
|
|
||||||
handler: impl Fn(&mut Self::ViewState, &gpui3::MouseDownEvent, &mut ViewContext<Self::ViewState>)
|
|
||||||
+ Send
|
|
||||||
+ Sync
|
|
||||||
+ 'static,
|
|
||||||
) -> Self
|
|
||||||
where
|
|
||||||
Self: Sized,
|
|
||||||
{
|
|
||||||
println!("WithSettings on_mouse_down");
|
|
||||||
|
|
||||||
let settings = self.settings.clone();
|
|
||||||
|
|
||||||
self.listeners()
|
|
||||||
.mouse_down
|
|
||||||
.push(Arc::new(move |view, event, bounds, phase, cx| {
|
|
||||||
cx.with_global(settings.clone(), |cx| handler(view, event, cx))
|
|
||||||
}));
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue