Mainline GPUI2 UI work (#3099)
This PR mainlines the current state of new GPUI2-based UI from the `gpui2-ui` branch. Included in this is a performance improvement to make use of the `TextLayoutCache` when calling `layout` for `Text` elements. Release Notes: - N/A --------- Co-authored-by: Nate Butler <iamnbutler@gmail.com> Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
c46137e40d
commit
456baaa112
18 changed files with 371 additions and 19 deletions
24
crates/storybook/src/stories/components/multi_buffer.rs
Normal file
24
crates/storybook/src/stories/components/multi_buffer.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
use ui::prelude::*;
|
||||
use ui::{hello_world_rust_buffer_example, MultiBuffer};
|
||||
|
||||
use crate::story::Story;
|
||||
|
||||
#[derive(Element, Default)]
|
||||
pub struct MultiBufferStory {}
|
||||
|
||||
impl MultiBufferStory {
|
||||
fn render<V: 'static>(&mut self, _: &mut V, cx: &mut ViewContext<V>) -> impl IntoElement<V> {
|
||||
let theme = theme(cx);
|
||||
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, MultiBuffer<V>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
.child(MultiBuffer::new(vec![
|
||||
hello_world_rust_buffer_example(&theme),
|
||||
hello_world_rust_buffer_example(&theme),
|
||||
hello_world_rust_buffer_example(&theme),
|
||||
hello_world_rust_buffer_example(&theme),
|
||||
hello_world_rust_buffer_example(&theme),
|
||||
]))
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue