Extract columns into separate objects.
Co-authored-by: Kyle <kyle@zed.dev>
This commit is contained in:
parent
f4121b42da
commit
4aa5df4cda
2 changed files with 110 additions and 121 deletions
|
@ -219,10 +219,8 @@ impl View for BufferSearchBar {
|
|||
cx,
|
||||
)
|
||||
};
|
||||
let icon_style = theme.search.editor_icon.clone();
|
||||
Flex::row()
|
||||
.with_child(
|
||||
Flex::column()
|
||||
|
||||
let nav_column = Flex::column()
|
||||
.with_child(
|
||||
Flex::row()
|
||||
.align_children_center()
|
||||
|
@ -240,8 +238,11 @@ impl View for BufferSearchBar {
|
|||
.constrained()
|
||||
.with_max_height(theme.search.search_bar_row_height),
|
||||
)
|
||||
.contained(),
|
||||
)
|
||||
.contained();
|
||||
|
||||
let icon_style = theme.search.editor_icon.clone();
|
||||
Flex::row()
|
||||
.with_child(nav_column)
|
||||
.with_child(
|
||||
Flex::column()
|
||||
.align_children_center()
|
||||
|
@ -263,6 +264,8 @@ impl View for BufferSearchBar {
|
|||
.left()
|
||||
.flex(1., true),
|
||||
)
|
||||
.with_child(
|
||||
Flex::row()
|
||||
.with_children(render_search_option(
|
||||
supported_options.case,
|
||||
"icons/case_insensitive_12.svg",
|
||||
|
@ -275,6 +278,9 @@ impl View for BufferSearchBar {
|
|||
SearchOptions::WHOLE_WORD,
|
||||
cx,
|
||||
))
|
||||
.flex(1., true)
|
||||
.contained(),
|
||||
)
|
||||
.contained()
|
||||
.with_style(editor_container)
|
||||
.aligned()
|
||||
|
|
|
@ -1551,25 +1551,14 @@ impl View for ProjectSearchBar {
|
|||
cx,
|
||||
)
|
||||
};
|
||||
|
||||
Flex::row()
|
||||
.with_child(
|
||||
Flex::column()
|
||||
let nav_column = Flex::column()
|
||||
.with_child(
|
||||
Flex::row()
|
||||
.align_children_center()
|
||||
.with_child(
|
||||
Flex::row()
|
||||
.with_child(nav_button_for_direction(
|
||||
"<",
|
||||
Direction::Prev,
|
||||
cx,
|
||||
))
|
||||
.with_child(nav_button_for_direction(
|
||||
">",
|
||||
Direction::Next,
|
||||
cx,
|
||||
))
|
||||
.with_child(nav_button_for_direction("<", Direction::Prev, cx))
|
||||
.with_child(nav_button_for_direction(">", Direction::Next, cx))
|
||||
.aligned(),
|
||||
)
|
||||
.with_children(matches)
|
||||
|
@ -1579,10 +1568,8 @@ impl View for ProjectSearchBar {
|
|||
.constrained()
|
||||
.with_height(theme.search.search_bar_row_height),
|
||||
)
|
||||
.flex(1., true),
|
||||
)
|
||||
.with_child(
|
||||
Flex::column()
|
||||
.flex(1., true);
|
||||
let editor_column = Flex::column()
|
||||
.align_children_center()
|
||||
.with_child(
|
||||
Flex::row()
|
||||
|
@ -1605,10 +1592,8 @@ impl View for ProjectSearchBar {
|
|||
.contained()
|
||||
.aligned()
|
||||
.top()
|
||||
.flex(1., false),
|
||||
)
|
||||
.with_child(
|
||||
Flex::column()
|
||||
.flex(1., false);
|
||||
let mode_column = Flex::column()
|
||||
.with_child(
|
||||
Flex::row()
|
||||
.align_children_center()
|
||||
|
@ -1617,8 +1602,6 @@ impl View for ProjectSearchBar {
|
|||
.with_child(search_button_for_mode(SearchMode::Text, cx))
|
||||
.with_children(semantic_index)
|
||||
.with_child(search_button_for_mode(SearchMode::Regex, cx))
|
||||
.constrained()
|
||||
.with_height(theme.search.search_bar_row_height)
|
||||
.aligned()
|
||||
.left()
|
||||
.contained()
|
||||
|
@ -1630,11 +1613,8 @@ impl View for ProjectSearchBar {
|
|||
&theme.search,
|
||||
cx,
|
||||
|_, this, cx| {
|
||||
if let Some(search) =
|
||||
this.active_project_search.as_mut()
|
||||
{
|
||||
search
|
||||
.update(cx, |_, cx| cx.emit(ViewEvent::Dismiss))
|
||||
if let Some(search) = this.active_project_search.as_mut() {
|
||||
search.update(cx, |_, cx| cx.emit(ViewEvent::Dismiss))
|
||||
}
|
||||
},
|
||||
None,
|
||||
|
@ -1656,8 +1636,11 @@ impl View for ProjectSearchBar {
|
|||
.then(|| Flex::row().flex(1., true)),
|
||||
)
|
||||
.contained()
|
||||
.flex(1., true),
|
||||
)
|
||||
.flex(1., true);
|
||||
Flex::row()
|
||||
.with_child(nav_column)
|
||||
.with_child(editor_column)
|
||||
.with_child(mode_column)
|
||||
.contained()
|
||||
.with_style(theme.search.container)
|
||||
.flex_float()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue