From 04354675ca2d2b9bedebcd4f2a5191289aaad9de Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 28 Aug 2023 10:35:23 -0700 Subject: [PATCH] Remove search dismiss button --- crates/search/src/buffer_search.rs | 9 +-------- crates/search/src/project_search.rs | 11 ----------- crates/search/src/search_bar.rs | 28 ---------------------------- 3 files changed, 1 insertion(+), 47 deletions(-) diff --git a/crates/search/src/buffer_search.rs b/crates/search/src/buffer_search.rs index e708781eca..01d4b7693f 100644 --- a/crates/search/src/buffer_search.rs +++ b/crates/search/src/buffer_search.rs @@ -214,7 +214,7 @@ impl View for BufferSearchBar { let icon_style = theme.search.editor_icon.clone(); let nav_column = Flex::row() - .with_child(self.render_action_button("Select All", cx)) + .with_child(self.render_action_button("all", cx)) .with_child(nav_button_for_direction("<", Direction::Prev, cx)) .with_child(nav_button_for_direction(">", Direction::Next, cx)) .with_child(Flex::row().with_children(match_count)) @@ -268,13 +268,6 @@ impl View for BufferSearchBar { .contained() .with_style(theme.search.modes_container), ) - .with_child(super::search_bar::render_close_button( - "Dismiss Buffer Search", - &theme.search, - cx, - |_, this, cx| this.dismiss(&Default::default(), cx), - Some(Box::new(Dismiss)), - )) .constrained() .with_height(theme.search.search_bar_row_height) .aligned() diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index 6364183877..8542124a25 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -1597,17 +1597,6 @@ impl View for ProjectSearchBar { .contained() .with_style(theme.search.modes_container), ) - .with_child(super::search_bar::render_close_button( - "Dismiss Project Search", - &theme.search, - cx, - |_, this, cx| { - if let Some(search) = this.active_project_search.as_mut() { - search.update(cx, |_, cx| cx.emit(ViewEvent::Dismiss)) - } - }, - None, - )) .constrained() .with_height(theme.search.search_bar_row_height) .aligned() diff --git a/crates/search/src/search_bar.rs b/crates/search/src/search_bar.rs index 7d3c5261ea..4676b8f027 100644 --- a/crates/search/src/search_bar.rs +++ b/crates/search/src/search_bar.rs @@ -13,34 +13,6 @@ use crate::{ SelectNextMatch, SelectPrevMatch, }; -pub(super) fn render_close_button( - tooltip: &'static str, - theme: &theme::Search, - cx: &mut ViewContext, - on_click: impl Fn(MouseClick, &mut V, &mut EventContext) + 'static, - dismiss_action: Option>, -) -> AnyElement { - let tooltip_style = theme::current(cx).tooltip.clone(); - - enum CloseButton {} - MouseEventHandler::new::(0, cx, |state, _| { - let style = theme.dismiss_button.style_for(state); - Svg::new("icons/x_mark_8.svg") - .with_color(style.color) - .constrained() - .with_width(style.icon_width) - .aligned() - .contained() - .with_style(style.container) - .constrained() - .with_height(theme.search_bar_row_height) - }) - .on_click(MouseButton::Left, on_click) - .with_cursor_style(CursorStyle::PointingHand) - .with_tooltip::(0, tooltip.to_string(), dismiss_action, tooltip_style, cx) - .into_any() -} - pub(super) fn render_nav_button( icon: &'static str, direction: Direction,