Revert deletion of FindEditor in theme

This commit is contained in:
Antonio Scandurra
2022-03-30 13:35:17 +02:00
parent 94097a56a1
commit 621e67bca7
4 changed files with 18 additions and 10 deletions
+5 -4
View File
@@ -77,7 +77,7 @@ impl View for BufferSearchBar {
let editor_container = if self.query_contains_error {
theme.search.invalid_editor
} else {
theme.search.editor.container
theme.search.editor.input.container
};
Flex::row()
.with_child(
@@ -107,7 +107,7 @@ impl View for BufferSearchBar {
.with_style(editor_container)
.aligned()
.constrained()
.with_max_width(theme.search.max_editor_width)
.with_max_width(theme.search.editor.max_width)
.boxed(),
)
.with_child(
@@ -157,8 +157,9 @@ impl ToolbarItemView for BufferSearchBar {
impl BufferSearchBar {
pub fn new(cx: &mut ViewContext<Self>) -> Self {
let query_editor =
cx.add_view(|cx| Editor::auto_height(2, Some(|theme| theme.search.editor.clone()), cx));
let query_editor = cx.add_view(|cx| {
Editor::auto_height(2, Some(|theme| theme.search.editor.input.clone()), cx)
});
cx.subscribe(&query_editor, Self::on_query_editor_event)
.detach();
+4 -3
View File
@@ -328,7 +328,8 @@ impl ProjectSearchView {
.detach();
let query_editor = cx.add_view(|cx| {
let mut editor = Editor::single_line(Some(|theme| theme.search.editor.clone()), cx);
let mut editor =
Editor::single_line(Some(|theme| theme.search.editor.input.clone()), cx);
editor.set_text(query_text, cx);
editor
});
@@ -685,7 +686,7 @@ impl View for ProjectSearchBar {
let editor_container = if search.query_contains_error {
theme.search.invalid_editor
} else {
theme.search.editor.container
theme.search.editor.input.container
};
Flex::row()
.with_child(
@@ -713,7 +714,7 @@ impl View for ProjectSearchBar {
.with_style(editor_container)
.aligned()
.constrained()
.with_max_width(theme.search.max_editor_width)
.with_max_width(theme.search.editor.max_width)
.boxed(),
)
.with_child(