Compute view ancestry at layout time
This commit is contained in:
@@ -670,13 +670,11 @@ mod tests {
|
||||
cx,
|
||||
)
|
||||
});
|
||||
let (_, root_view) = cx.add_window(|_| EmptyView);
|
||||
let (window_id, _root_view) = cx.add_window(|_| EmptyView);
|
||||
|
||||
let editor = cx.add_view(&root_view, |cx| {
|
||||
Editor::for_buffer(buffer.clone(), None, cx)
|
||||
});
|
||||
let editor = cx.add_view(window_id, |cx| Editor::for_buffer(buffer.clone(), None, cx));
|
||||
|
||||
let search_bar = cx.add_view(&root_view, |cx| {
|
||||
let search_bar = cx.add_view(window_id, |cx| {
|
||||
let mut search_bar = BufferSearchBar::new(cx);
|
||||
search_bar.set_active_pane_item(Some(&editor), cx);
|
||||
search_bar.show(false, true, cx);
|
||||
|
||||
@@ -939,8 +939,6 @@ impl ToolbarItemView for ProjectSearchBar {
|
||||
self.subscription = None;
|
||||
self.active_project_search = None;
|
||||
if let Some(search) = active_pane_item.and_then(|i| i.downcast::<ProjectSearchView>()) {
|
||||
let query_editor = search.read(cx).query_editor.clone();
|
||||
cx.reparent(&query_editor);
|
||||
self.subscription = Some(cx.observe(&search, |_, _, cx| cx.notify()));
|
||||
self.active_project_search = Some(search);
|
||||
ToolbarItemLocation::PrimaryLeft {
|
||||
|
||||
Reference in New Issue
Block a user