Fix a porting bugs for terminal2

co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Mikayla
2023-12-06 15:11:49 -08:00
co-authored by Nathan
parent 735f2029e9
commit 12e7f61f62
6 changed files with 36 additions and 67 deletions
-26
View File
@@ -95,32 +95,6 @@ pub trait InteractiveElement: Sized + Element {
self
}
fn on_mouse_down_weird(
mut self,
button: MouseButton,
listener: impl Fn(&MouseDownEvent, &mut WindowContext) + 'static,
) -> Self {
self.interactivity().mouse_down_listeners.push(Box::new(
move |event, bounds, phase, cx| {
dbg!("HEREEEE");
let contains = dbg!(dbg!(&bounds.bounds).contains_point(dbg!(&event.position)))
&& dbg!(cx.was_top_layer(&event.position, &bounds.stacking_order));
dbg!(contains);
if phase == DispatchPhase::Bubble
&& event.button == button
&& bounds.visibly_contains(&event.position, cx)
{
dbg!("HEREEEE2");
(listener)(event, cx)
}
},
));
self
}
fn on_any_mouse_down(
mut self,
listener: impl Fn(&MouseDownEvent, &mut WindowContext) + 'static,
+13 -13
View File
@@ -66,11 +66,11 @@ impl PlatformWindow for TestWindow {
}
fn titlebar_height(&self) -> Pixels {
todo!()
unimplemented!()
}
fn appearance(&self) -> WindowAppearance {
todo!()
unimplemented!()
}
fn display(&self) -> std::rc::Rc<dyn crate::PlatformDisplay> {
@@ -99,7 +99,7 @@ impl PlatformWindow for TestWindow {
}
fn activate(&self) {
todo!()
unimplemented!()
}
fn set_title(&mut self, title: &str) {
@@ -107,23 +107,23 @@ impl PlatformWindow for TestWindow {
}
fn set_edited(&mut self, _edited: bool) {
todo!()
unimplemented!()
}
fn show_character_palette(&self) {
todo!()
unimplemented!()
}
fn minimize(&self) {
todo!()
unimplemented!()
}
fn zoom(&self) {
todo!()
unimplemented!()
}
fn toggle_full_screen(&self) {
todo!()
unimplemented!()
}
fn on_input(&self, callback: Box<dyn FnMut(crate::InputEvent) -> bool>) {
@@ -139,7 +139,7 @@ impl PlatformWindow for TestWindow {
}
fn on_fullscreen(&self, _callback: Box<dyn FnMut(bool)>) {
todo!()
unimplemented!()
}
fn on_moved(&self, callback: Box<dyn FnMut()>) {
@@ -147,19 +147,19 @@ impl PlatformWindow for TestWindow {
}
fn on_should_close(&self, _callback: Box<dyn FnMut() -> bool>) {
todo!()
unimplemented!()
}
fn on_close(&self, _callback: Box<dyn FnOnce()>) {
todo!()
unimplemented!()
}
fn on_appearance_changed(&self, _callback: Box<dyn FnMut()>) {
todo!()
unimplemented!()
}
fn is_topmost_for_position(&self, _position: crate::Point<Pixels>) -> bool {
todo!()
unimplemented!()
}
fn draw(&self, scene: crate::Scene) {