From d95b036fde3e3b35ba6c52b7f97fdb7719b30a28 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Tue, 15 Aug 2023 10:58:24 -0700 Subject: [PATCH] Fix cursor style co-authored-by: Nate --- crates/collab_ui/src/collab_panel.rs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index 0665ecf75b..2b79f5a125 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -1283,7 +1283,7 @@ impl CollabPanel { let can_collapse = depth > 0; let icon_size = (&theme.collab_panel).section_icon_size; - MouseEventHandler::new::(section as usize, cx, |state, _| { + let mut result = MouseEventHandler::new::(section as usize, cx, |state, _| { let header_style = if can_collapse { theme .collab_panel @@ -1328,14 +1328,19 @@ impl CollabPanel { .with_height(theme.collab_panel.row_height) .contained() .with_style(header_style.container) - }) - .with_cursor_style(CursorStyle::PointingHand) - .on_click(MouseButton::Left, move |_, this, cx| { - if can_collapse { - this.toggle_expanded(section, cx); - } - }) - .into_any() + }); + + if can_collapse { + result = result + .with_cursor_style(CursorStyle::PointingHand) + .on_click(MouseButton::Left, move |_, this, cx| { + if can_collapse { + this.toggle_expanded(section, cx); + } + }) + } + + result.into_any() } fn render_contact( @@ -1612,6 +1617,7 @@ impl CollabPanel { .on_click(MouseButton::Right, move |e, this, cx| { this.deploy_channel_context_menu(Some(e.position), channel_id, cx); }) + .with_cursor_style(CursorStyle::PointingHand) .into_any() }