
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>
25 lines
547 B
Rust
25 lines
547 B
Rust
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())
|
|
}
|
|
}
|