Revert deletion of FindEditor
in theme
This commit is contained in:
parent
94097a56a1
commit
621e67bca7
4 changed files with 18 additions and 10 deletions
|
@ -77,7 +77,7 @@ impl View for BufferSearchBar {
|
||||||
let editor_container = if self.query_contains_error {
|
let editor_container = if self.query_contains_error {
|
||||||
theme.search.invalid_editor
|
theme.search.invalid_editor
|
||||||
} else {
|
} else {
|
||||||
theme.search.editor.container
|
theme.search.editor.input.container
|
||||||
};
|
};
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(
|
.with_child(
|
||||||
|
@ -107,7 +107,7 @@ impl View for BufferSearchBar {
|
||||||
.with_style(editor_container)
|
.with_style(editor_container)
|
||||||
.aligned()
|
.aligned()
|
||||||
.constrained()
|
.constrained()
|
||||||
.with_max_width(theme.search.max_editor_width)
|
.with_max_width(theme.search.editor.max_width)
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.with_child(
|
.with_child(
|
||||||
|
@ -157,8 +157,9 @@ impl ToolbarItemView for BufferSearchBar {
|
||||||
|
|
||||||
impl BufferSearchBar {
|
impl BufferSearchBar {
|
||||||
pub fn new(cx: &mut ViewContext<Self>) -> Self {
|
pub fn new(cx: &mut ViewContext<Self>) -> Self {
|
||||||
let query_editor =
|
let query_editor = cx.add_view(|cx| {
|
||||||
cx.add_view(|cx| Editor::auto_height(2, Some(|theme| theme.search.editor.clone()), cx));
|
Editor::auto_height(2, Some(|theme| theme.search.editor.input.clone()), cx)
|
||||||
|
});
|
||||||
cx.subscribe(&query_editor, Self::on_query_editor_event)
|
cx.subscribe(&query_editor, Self::on_query_editor_event)
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,8 @@ impl ProjectSearchView {
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
let query_editor = cx.add_view(|cx| {
|
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.set_text(query_text, cx);
|
||||||
editor
|
editor
|
||||||
});
|
});
|
||||||
|
@ -685,7 +686,7 @@ impl View for ProjectSearchBar {
|
||||||
let editor_container = if search.query_contains_error {
|
let editor_container = if search.query_contains_error {
|
||||||
theme.search.invalid_editor
|
theme.search.invalid_editor
|
||||||
} else {
|
} else {
|
||||||
theme.search.editor.container
|
theme.search.editor.input.container
|
||||||
};
|
};
|
||||||
Flex::row()
|
Flex::row()
|
||||||
.with_child(
|
.with_child(
|
||||||
|
@ -713,7 +714,7 @@ impl View for ProjectSearchBar {
|
||||||
.with_style(editor_container)
|
.with_style(editor_container)
|
||||||
.aligned()
|
.aligned()
|
||||||
.constrained()
|
.constrained()
|
||||||
.with_max_width(theme.search.max_editor_width)
|
.with_max_width(theme.search.editor.max_width)
|
||||||
.boxed(),
|
.boxed(),
|
||||||
)
|
)
|
||||||
.with_child(
|
.with_child(
|
||||||
|
|
|
@ -105,8 +105,7 @@ pub struct Toolbar {
|
||||||
pub struct Search {
|
pub struct Search {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub container: ContainerStyle,
|
pub container: ContainerStyle,
|
||||||
pub max_editor_width: f32,
|
pub editor: FindEditor,
|
||||||
pub editor: FieldEditor,
|
|
||||||
pub invalid_editor: ContainerStyle,
|
pub invalid_editor: ContainerStyle,
|
||||||
pub option_button_group: ContainerStyle,
|
pub option_button_group: ContainerStyle,
|
||||||
pub option_button: ContainedText,
|
pub option_button: ContainedText,
|
||||||
|
@ -120,6 +119,13 @@ pub struct Search {
|
||||||
pub tab_icon_spacing: f32,
|
pub tab_icon_spacing: f32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Deserialize, Default)]
|
||||||
|
pub struct FindEditor {
|
||||||
|
#[serde(flatten)]
|
||||||
|
pub input: FieldEditor,
|
||||||
|
pub max_width: f32,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Default)]
|
#[derive(Deserialize, Default)]
|
||||||
pub struct Sidebar {
|
pub struct Sidebar {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
|
|
|
@ -361,7 +361,6 @@ tab_icon_spacing = 4
|
||||||
tab_summary_spacing = 10
|
tab_summary_spacing = 10
|
||||||
|
|
||||||
[search]
|
[search]
|
||||||
max_editor_width = 250
|
|
||||||
match_background = "$state.highlighted_line"
|
match_background = "$state.highlighted_line"
|
||||||
results_status = { extends = "$text.0", size = 18 }
|
results_status = { extends = "$text.0", size = 18 }
|
||||||
tab_icon_width = 14
|
tab_icon_width = 14
|
||||||
|
@ -396,6 +395,7 @@ extends = "$text.2"
|
||||||
padding = 6
|
padding = 6
|
||||||
|
|
||||||
[search.editor]
|
[search.editor]
|
||||||
|
max_width = 250
|
||||||
background = "$surface.0"
|
background = "$surface.0"
|
||||||
corner_radius = 6
|
corner_radius = 6
|
||||||
padding = { left = 13, right = 13, top = 3, bottom = 3 }
|
padding = { left = 13, right = 13, top = 3, bottom = 3 }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue