Deploy the buffer search in a second row in the toolbar (#3630)

This PR updates the buffer search to deploy to a second row in the
toolbar, instead of trying to deploy into the initial row.

This is the same way it works in Zed1.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-12-13 13:06:53 -05:00 committed by GitHub
parent 07a266d93f
commit 61ab1834c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View file

@ -23,7 +23,7 @@ use util::ResultExt;
use workspace::{
item::ItemHandle,
searchable::{Direction, SearchEvent, SearchableItemHandle, WeakSearchableItemHandle},
ToolbarItemLocation, ToolbarItemView, Workspace,
ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView, Workspace,
};
#[derive(PartialEq, Clone, Deserialize)]
@ -456,6 +456,9 @@ impl BufferSearchBar {
cx.focus(&handle);
}
cx.emit(Event::UpdateLocation);
cx.emit(ToolbarItemEvent::ChangeLocation(
ToolbarItemLocation::Hidden,
));
cx.notify();
}
@ -488,6 +491,9 @@ impl BufferSearchBar {
self.dismissed = false;
cx.notify();
cx.emit(Event::UpdateLocation);
cx.emit(ToolbarItemEvent::ChangeLocation(
ToolbarItemLocation::Secondary,
));
true
}