gpui-kit GitHub

Scenes

context-menu

Builds Avatar Button Checkbox CommandPalette ContextMenu DescriptionList Divider EmptyState Icon List Menu Popover ProgressBar Tag Timeline

context-menu in the dark theme
studio-dark
context-menu in the light theme
studio-light

The code that drew it

A still frame holds a repeating animation at its first frame and a one-shot at its last, because a still of a moving thing is not reproducible. Run the gallery to review motion.

fn context_menu(window: &mut Window, cx: &mut App) -> AnyElement {
    ensure_menus(window, cx);
    let context = cx.global::<SceneMenus>().context.clone();
    let theme = cx.theme().clone();
    stack(&theme)
        .w(px(560.0))
        .h(px(400.0))
        // Opening a context menu reports the row that was pointed at; what is
        // selected stays the host's answer.
        .child(div().child("The right-click reports the row. Nothing is selected by it."))
        .child(context)
        .into_any_element()
}