Make project search feel better (#14674)
Release Notes: - Improved UX of project search --------- Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
parent
84b34677e2
commit
09b216cf5e
5 changed files with 123 additions and 64 deletions
|
@ -52,10 +52,10 @@ bitflags! {
|
|||
impl SearchOptions {
|
||||
pub fn label(&self) -> &'static str {
|
||||
match *self {
|
||||
SearchOptions::WHOLE_WORD => "whole word",
|
||||
SearchOptions::CASE_SENSITIVE => "match case",
|
||||
SearchOptions::INCLUDE_IGNORED => "include Ignored",
|
||||
SearchOptions::REGEX => "regular expression",
|
||||
SearchOptions::WHOLE_WORD => "Match whole words",
|
||||
SearchOptions::CASE_SENSITIVE => "Match case sensitively",
|
||||
SearchOptions::INCLUDE_IGNORED => "Also search files ignored by configuration",
|
||||
SearchOptions::REGEX => "Use regular expressions",
|
||||
_ => panic!("{:?} is not a named SearchOption", self),
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ impl SearchOptions {
|
|||
match *self {
|
||||
SearchOptions::WHOLE_WORD => ui::IconName::WholeWord,
|
||||
SearchOptions::CASE_SENSITIVE => ui::IconName::CaseSensitive,
|
||||
SearchOptions::INCLUDE_IGNORED => ui::IconName::FileGit,
|
||||
SearchOptions::INCLUDE_IGNORED => ui::IconName::Sliders,
|
||||
SearchOptions::REGEX => ui::IconName::Regex,
|
||||
_ => panic!("{:?} is not a named SearchOption", self),
|
||||
}
|
||||
|
@ -104,8 +104,8 @@ impl SearchOptions {
|
|||
.selected(active)
|
||||
.tooltip({
|
||||
let action = self.to_toggle_action();
|
||||
let label: SharedString = format!("Toggle {}", self.label()).into();
|
||||
move |cx| Tooltip::for_action(label.clone(), &*action, cx)
|
||||
let label = self.label();
|
||||
move |cx| Tooltip::for_action(label, &*action, cx)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue