From d34da2db697baeb6044530ca4ee8a5c32141e8d4 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Wed, 9 Aug 2023 01:37:17 +0200 Subject: [PATCH] fix dismiss tooltip for project search --- crates/search/src/buffer_search.rs | 1 + crates/search/src/project_search.rs | 1 + crates/search/src/search_bar.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/search/src/buffer_search.rs b/crates/search/src/buffer_search.rs index 845d943f4e..36dbe77bb4 100644 --- a/crates/search/src/buffer_search.rs +++ b/crates/search/src/buffer_search.rs @@ -288,6 +288,7 @@ impl View for BufferSearchBar { .with_child(search_button_for_mode(SearchMode::Text, cx)) .with_child(search_button_for_mode(SearchMode::Regex, cx)) .with_child(super::search_bar::render_close_button( + "Dismiss Buffer Search", &theme.search, cx, |_, this, cx| this.dismiss(&Default::default(), cx), diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index b607848e21..8939279f3b 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -1626,6 +1626,7 @@ impl View for ProjectSearchBar { .with_children(semantic_index) .with_child(search_button_for_mode(SearchMode::Regex, cx)) .with_child(super::search_bar::render_close_button( + "Dismiss Project Search", &theme.search, cx, |_, this, cx| { diff --git a/crates/search/src/search_bar.rs b/crates/search/src/search_bar.rs index 446039e960..19d8fa6b98 100644 --- a/crates/search/src/search_bar.rs +++ b/crates/search/src/search_bar.rs @@ -13,12 +13,12 @@ use crate::{ }; 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 = "Dismiss Buffer Search"; let tooltip_style = theme::current(cx).tooltip.clone(); enum CloseButton {}