
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>
21 lines
701 B
Rust
21 lines
701 B
Rust
use ui::prelude::*;
|
|
use ui::{ContextMenu, ContextMenuItem, Label};
|
|
|
|
use crate::story::Story;
|
|
|
|
#[derive(Element, Default)]
|
|
pub struct ContextMenuStory {}
|
|
|
|
impl ContextMenuStory {
|
|
fn render<V: 'static>(&mut self, _: &mut V, cx: &mut ViewContext<V>) -> impl IntoElement<V> {
|
|
Story::container(cx)
|
|
//.fill(theme.middle.base.default.background)
|
|
.child(Story::title_for::<_, ContextMenu>(cx))
|
|
.child(Story::label(cx, "Default"))
|
|
.child(ContextMenu::new([
|
|
ContextMenuItem::header("Section header"),
|
|
ContextMenuItem::Separator,
|
|
ContextMenuItem::entry(Label::new("Some entry")),
|
|
]))
|
|
}
|
|
}
|