Capitalize tooltip labels on buffer search (#18458)

For consistency, as this seems to be the pattern we're using overall for
labels and buttons.

---

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2024-09-27 22:02:32 +02:00 committed by GitHub
parent d5f67406b0
commit 1c5be9de4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 10 deletions

View file

@ -288,7 +288,7 @@ impl Render for BufferSearchBar {
let focus_handle = focus_handle.clone(); let focus_handle = focus_handle.clone();
move |cx| { move |cx| {
Tooltip::for_action_in( Tooltip::for_action_in(
"Toggle search selection", "Toggle Search Selection",
&ToggleSelection, &ToggleSelection,
&focus_handle, &focus_handle,
cx, cx,
@ -308,7 +308,7 @@ impl Render for BufferSearchBar {
let focus_handle = focus_handle.clone(); let focus_handle = focus_handle.clone();
move |cx| { move |cx| {
Tooltip::for_action_in( Tooltip::for_action_in(
"Select all matches", "Select All Matches",
&SelectAllMatches, &SelectAllMatches,
&focus_handle, &focus_handle,
cx, cx,
@ -319,14 +319,14 @@ impl Render for BufferSearchBar {
.child(render_nav_button( .child(render_nav_button(
ui::IconName::ChevronLeft, ui::IconName::ChevronLeft,
self.active_match_index.is_some(), self.active_match_index.is_some(),
"Select previous match", "Select Previous Match",
&SelectPrevMatch, &SelectPrevMatch,
focus_handle.clone(), focus_handle.clone(),
)) ))
.child(render_nav_button( .child(render_nav_button(
ui::IconName::ChevronRight, ui::IconName::ChevronRight,
self.active_match_index.is_some(), self.active_match_index.is_some(),
"Select next match", "Select Next Match",
&SelectNextMatch, &SelectNextMatch,
focus_handle.clone(), focus_handle.clone(),
)) ))
@ -373,7 +373,7 @@ impl Render for BufferSearchBar {
let focus_handle = focus_handle.clone(); let focus_handle = focus_handle.clone();
move |cx| { move |cx| {
Tooltip::for_action_in( Tooltip::for_action_in(
"Replace next match", "Replace Next Match",
&ReplaceNext, &ReplaceNext,
&focus_handle, &focus_handle,
cx, cx,
@ -390,7 +390,7 @@ impl Render for BufferSearchBar {
let focus_handle = focus_handle.clone(); let focus_handle = focus_handle.clone();
move |cx| { move |cx| {
Tooltip::for_action_in( Tooltip::for_action_in(
"Replace all matches", "Replace All Matches",
&ReplaceAll, &ReplaceAll,
&focus_handle, &focus_handle,
cx, cx,
@ -442,7 +442,7 @@ impl Render for BufferSearchBar {
div.child( div.child(
IconButton::new(SharedString::from("Close"), IconName::Close) IconButton::new(SharedString::from("Close"), IconName::Close)
.tooltip(move |cx| { .tooltip(move |cx| {
Tooltip::for_action("Close search bar", &Dismiss, cx) Tooltip::for_action("Close Search Bar", &Dismiss, cx)
}) })
.on_click(cx.listener(|this, _: &ClickEvent, cx| { .on_click(cx.listener(|this, _: &ClickEvent, cx| {
this.dismiss(&Dismiss, cx) this.dismiss(&Dismiss, cx)

View file

@ -53,10 +53,10 @@ bitflags! {
impl SearchOptions { impl SearchOptions {
pub fn label(&self) -> &'static str { pub fn label(&self) -> &'static str {
match *self { match *self {
SearchOptions::WHOLE_WORD => "Match whole words", SearchOptions::WHOLE_WORD => "Match Whole Words",
SearchOptions::CASE_SENSITIVE => "Match case sensitively", SearchOptions::CASE_SENSITIVE => "Match Case Sensitively",
SearchOptions::INCLUDE_IGNORED => "Also search files ignored by configuration", SearchOptions::INCLUDE_IGNORED => "Also search files ignored by configuration",
SearchOptions::REGEX => "Use regular expressions", SearchOptions::REGEX => "Use Regular Expressions",
_ => panic!("{:?} is not a named SearchOption", self), _ => panic!("{:?} is not a named SearchOption", self),
} }
} }