mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-04 18:15:21 +00:00
Z-1074/search default label (#2547)
This commit adds a default "Project search" tooltip for empty search panes. Fixes Linear ticket Z-1074 Release Notes: - Added default tooltip to empty search panes. ([#1533](https://github.com/zed-industries/community/issues/1533)).
This commit is contained in:
commit
571d2f4966
1 changed files with 8 additions and 2 deletions
|
@ -25,7 +25,7 @@ use std::{
|
|||
borrow::Cow,
|
||||
collections::HashSet,
|
||||
mem,
|
||||
ops::Range,
|
||||
ops::{Not, Range},
|
||||
path::PathBuf,
|
||||
sync::Arc,
|
||||
};
|
||||
|
@ -242,7 +242,13 @@ impl View for ProjectSearchView {
|
|||
|
||||
impl Item for ProjectSearchView {
|
||||
fn tab_tooltip_text(&self, cx: &AppContext) -> Option<Cow<str>> {
|
||||
Some(self.query_editor.read(cx).text(cx).into())
|
||||
let query_text = self.query_editor.read(cx).text(cx);
|
||||
|
||||
query_text
|
||||
.is_empty()
|
||||
.not()
|
||||
.then(|| query_text.into())
|
||||
.or_else(|| Some("Project Search".into()))
|
||||
}
|
||||
|
||||
fn act_as_type<'a>(
|
||||
|
|
Loading…
Reference in a new issue