Mainline GPUI2 UI work (#3062)
This PR mainlines the current state of new GPUI2-based UI from the `gpui2-ui` branch. Release Notes: - N/A --------- Co-authored-by: Nate Butler <iamnbutler@gmail.com> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Co-authored-by: Nate <nate@zed.dev> Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
e7ee8a95f6
commit
f26ca0866c
85 changed files with 4658 additions and 1623 deletions
25
crates/ui/src/components/editor.rs
Normal file
25
crates/ui/src/components/editor.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
use std::marker::PhantomData;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::{Buffer, Toolbar};
|
||||
|
||||
#[derive(Element)]
|
||||
struct Editor<V: 'static> {
|
||||
view_type: PhantomData<V>,
|
||||
toolbar: Toolbar,
|
||||
buffer: Buffer<V>,
|
||||
}
|
||||
|
||||
impl<V: 'static> Editor<V> {
|
||||
pub fn new(toolbar: Toolbar, buffer: Buffer<V>) -> Self {
|
||||
Self {
|
||||
view_type: PhantomData,
|
||||
toolbar,
|
||||
buffer,
|
||||
}
|
||||
}
|
||||
|
||||
fn render(&mut self, _: &mut V, cx: &mut ViewContext<V>) -> impl IntoElement<V> {
|
||||
div().child(self.toolbar.clone())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue