Menubar view
A row of menus, at most one of them open.
A view survives a frame. Hold it in an Entity with cx.new(..) and reach it with .update(..).
use gpui_kit::overlay::Menubar;
Construct
new(ident: impl Into<Ident>, menus: impl IntoIterator<Item = MenubarMenu>, window: &mut Window, cx: &mut Context<Self>) -> SelfOptions
Chain onto the value.
control_size(size: ControlSize) -> SelfCommands
Need a Context, so they need a view.
set_menus(menus: Vec<MenubarMenu>, window: &mut Window, cx: &mut Context<Self>)
open(id: &str, window: &mut Window, cx: &mut Context<Self>)
close(window: &mut Window, cx: &mut Context<Self>)Queries
Only answer; they change nothing.
open_menu() -> Option<&SharedString>
menus() -> &[MenubarMenu]Reports
The variants of the event it emits. It never applies the change itself.
- Opened
- Invoked
- Closed
Rendered by
Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.