Use placeholder in include/exclude editors
This commit is contained in:
parent
0e31d13a1e
commit
80fc1bc276
1 changed files with 10 additions and 22 deletions
|
@ -452,12 +452,15 @@ impl ProjectSearchView {
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
let included_files_editor = cx.add_view(|cx| {
|
let included_files_editor = cx.add_view(|cx| {
|
||||||
Editor::single_line(
|
let mut editor = Editor::single_line(
|
||||||
Some(Arc::new(|theme| {
|
Some(Arc::new(|theme| {
|
||||||
theme.search.include_exclude_editor.input.clone()
|
theme.search.include_exclude_editor.input.clone()
|
||||||
})),
|
})),
|
||||||
cx,
|
cx,
|
||||||
)
|
);
|
||||||
|
editor.set_placeholder_text("Include: crates/**/*.toml", cx);
|
||||||
|
|
||||||
|
editor
|
||||||
});
|
});
|
||||||
// Subcribe to include_files_editor in order to reraise editor events for workspace item activation purposes
|
// Subcribe to include_files_editor in order to reraise editor events for workspace item activation purposes
|
||||||
cx.subscribe(&included_files_editor, |_, _, event, cx| {
|
cx.subscribe(&included_files_editor, |_, _, event, cx| {
|
||||||
|
@ -466,12 +469,15 @@ impl ProjectSearchView {
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
let excluded_files_editor = cx.add_view(|cx| {
|
let excluded_files_editor = cx.add_view(|cx| {
|
||||||
Editor::single_line(
|
let mut editor = Editor::single_line(
|
||||||
Some(Arc::new(|theme| {
|
Some(Arc::new(|theme| {
|
||||||
theme.search.include_exclude_editor.input.clone()
|
theme.search.include_exclude_editor.input.clone()
|
||||||
})),
|
})),
|
||||||
cx,
|
cx,
|
||||||
)
|
);
|
||||||
|
editor.set_placeholder_text("Exclude: vendor/*, *.lock", cx);
|
||||||
|
|
||||||
|
editor
|
||||||
});
|
});
|
||||||
// Subcribe to excluded_files_editor in order to reraise editor events for workspace item activation purposes
|
// Subcribe to excluded_files_editor in order to reraise editor events for workspace item activation purposes
|
||||||
cx.subscribe(&excluded_files_editor, |_, _, event, cx| {
|
cx.subscribe(&excluded_files_editor, |_, _, event, cx| {
|
||||||
|
@ -1045,15 +1051,6 @@ impl View for ProjectSearchBar {
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(
|
.with_child(
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(
|
|
||||||
Label::new(
|
|
||||||
"Include:",
|
|
||||||
theme.search.include_exclude_inputs.text.clone(),
|
|
||||||
)
|
|
||||||
.contained()
|
|
||||||
.with_style(theme.search.include_exclude_inputs.container)
|
|
||||||
.aligned(),
|
|
||||||
)
|
|
||||||
.with_child(included_files_view)
|
.with_child(included_files_view)
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(theme.search.include_exclude_editor.input.container)
|
.with_style(theme.search.include_exclude_editor.input.container)
|
||||||
|
@ -1065,15 +1062,6 @@ impl View for ProjectSearchBar {
|
||||||
)
|
)
|
||||||
.with_child(
|
.with_child(
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(
|
|
||||||
Label::new(
|
|
||||||
"Exclude:",
|
|
||||||
theme.search.include_exclude_inputs.text.clone(),
|
|
||||||
)
|
|
||||||
.contained()
|
|
||||||
.with_style(theme.search.include_exclude_inputs.container)
|
|
||||||
.aligned(),
|
|
||||||
)
|
|
||||||
.with_child(excluded_files_view)
|
.with_child(excluded_files_view)
|
||||||
.contained()
|
.contained()
|
||||||
.with_style(theme.search.include_exclude_editor.input.container)
|
.with_style(theme.search.include_exclude_editor.input.container)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue