From 1fc6276eaba51b1544f130cfa4c0f5537e129fea Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 25 Jan 2023 09:09:59 -0800 Subject: [PATCH] Remove debug wiring --- crates/gpui/src/presenter.rs | 9 +++-- crates/workspace/src/workspace.rs | 57 +------------------------------ 2 files changed, 8 insertions(+), 58 deletions(-) diff --git a/crates/gpui/src/presenter.rs b/crates/gpui/src/presenter.rs index 5bff7e7bb1..1fff5c50b5 100644 --- a/crates/gpui/src/presenter.rs +++ b/crates/gpui/src/presenter.rs @@ -31,7 +31,6 @@ use std::{ ops::{Deref, DerefMut, Range}, sync::Arc, }; -use time::Instant; pub struct Presenter { window_id: usize, @@ -318,8 +317,14 @@ impl Presenter { } } - if cx.is_topmost_window_for_position(self.window_id, *position) { + let t0 = std::time::Instant::now(); + let is_topmost_window = + cx.is_topmost_window_for_position(self.window_id, *position); + println!("is_topmost_window => {:?}", t0.elapsed()); + if is_topmost_window { + let t1 = std::time::Instant::now(); cx.platform().set_cursor_style(style_to_assign); + println!("set_cursor_style => {:?}", t1.elapsed()); } if !event_reused { diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 71c5ef97a2..b0abe09070 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -31,9 +31,8 @@ use futures::{ }; use gpui::{ actions, - color::Color, elements::*, - geometry::vector::{vec2f, Vector2F}, + geometry::vector::Vector2F, impl_actions, impl_internal_actions, keymap_matcher::KeymapContext, platform::{CursorStyle, WindowOptions}, @@ -101,7 +100,6 @@ actions!( NewTerminal, NewSearch, Feedback, - ShowNotif, ] ); @@ -264,59 +262,6 @@ pub fn init(app_state: Arc, cx: &mut MutableAppContext) { client.add_view_request_handler(Workspace::handle_follow); client.add_view_message_handler(Workspace::handle_unfollow); client.add_view_message_handler(Workspace::handle_update_followers); - - // REMEMBER TO DELETE THE SHOW NOTIF - cx.add_action( - |_workspace: &mut Workspace, _: &ShowNotif, cx: &mut ViewContext| { - struct DummyView; - - impl Entity for DummyView { - type Event = (); - } - - impl View for DummyView { - fn ui_name() -> &'static str { - "DummyView" - } - fn render(&mut self, cx: &mut RenderContext<'_, Self>) -> ElementBox { - MouseEventHandler::::new(0, cx, |state, _cx| { - Empty::new() - .contained() - .with_background_color(if state.hovered() { - Color::red() - } else { - Color::blue() - }) - .constrained() - .with_width(200.) - .with_height(200.) - .boxed() - }) - .on_click(MouseButton::Left, |_, _| { - println!("click"); - }) - .with_cursor_style(CursorStyle::ResizeUpDown) - .boxed() - } - } - - cx.add_window( - WindowOptions { - bounds: gpui::WindowBounds::Fixed(gpui::geometry::rect::RectF::new( - vec2f(400., 200.), - vec2f(300., 200.), - )), - titlebar: None, - center: false, - focus: false, - kind: gpui::WindowKind::PopUp, - is_movable: true, - screen: None, - }, - |_cx| DummyView, - ) - }, - ) } type ProjectItemBuilders = HashMap<