Add placeholder BufferSearch
This commit is contained in:
parent
c70f220db3
commit
349ad7858b
3 changed files with 25 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
mod assistant_panel;
|
mod assistant_panel;
|
||||||
mod breadcrumb;
|
mod breadcrumb;
|
||||||
mod buffer;
|
mod buffer;
|
||||||
|
mod buffer_search;
|
||||||
mod chat_panel;
|
mod chat_panel;
|
||||||
mod collab_panel;
|
mod collab_panel;
|
||||||
mod command_palette;
|
mod command_palette;
|
||||||
|
@ -33,6 +34,7 @@ mod workspace;
|
||||||
pub use assistant_panel::*;
|
pub use assistant_panel::*;
|
||||||
pub use breadcrumb::*;
|
pub use breadcrumb::*;
|
||||||
pub use buffer::*;
|
pub use buffer::*;
|
||||||
|
pub use buffer_search::*;
|
||||||
pub use chat_panel::*;
|
pub use chat_panel::*;
|
||||||
pub use collab_panel::*;
|
pub use collab_panel::*;
|
||||||
pub use command_palette::*;
|
pub use command_palette::*;
|
||||||
|
|
20
crates/ui2/src/components/buffer_search.rs
Normal file
20
crates/ui2/src/components/buffer_search.rs
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
use crate::prelude::*;
|
||||||
|
use crate::EditorPane;
|
||||||
|
|
||||||
|
#[derive(Element)]
|
||||||
|
#[element(view_state = "EditorPane")]
|
||||||
|
pub struct BufferSearch {}
|
||||||
|
|
||||||
|
impl BufferSearch {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn render(
|
||||||
|
&mut self,
|
||||||
|
_view: &mut EditorPane,
|
||||||
|
cx: &mut ViewContext<EditorPane>,
|
||||||
|
) -> impl Element<ViewState = EditorPane> {
|
||||||
|
div().child("This is where Buffer Search goes.")
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,8 +4,8 @@ use gpui3::{view, Context, View};
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
hello_world_rust_editor_with_status_example, v_stack, Breadcrumb, Buffer, Icon, IconButton,
|
hello_world_rust_editor_with_status_example, v_stack, Breadcrumb, Buffer, BufferSearch, Icon,
|
||||||
IconColor, Symbol, Tab, TabBar, Toolbar,
|
IconButton, IconColor, Symbol, Tab, TabBar, Toolbar,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -69,6 +69,7 @@ impl EditorPane {
|
||||||
IconButton::new(Icon::MagicWand),
|
IconButton::new(Icon::MagicWand),
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
|
.children(Some(BufferSearch::new()).filter(|_| self.is_buffer_search_open))
|
||||||
.child(self.buffer.clone())
|
.child(self.buffer.clone())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue