Menus
Mojo supports four types of menu widgets. Each is fairly unique, but they share some common design elements and can be used in similar ways. You should review the User Interface Guidelines to see how best to apply each menu type and for general information on designing menus for your application.
- Application menu
A conventional desktop-style menu that drops down from the top-left corner of the screen when the user taps in that area.
- View menu
Menus used across the top of the screen. They can be used as display headers or action buttons, to pop up submenus, or to toggle settings.
- Command menu
Used to set menus or (more typically) buttons across the bottom of the screen for actions, to pop up submenus, or to toggle settings.
- Submenu
Can be used in conjunction with the other menu types to provide more options, or can be attached to any element in the page.
Application, View, and Command menus are technically very similar:
they use a single model definition with a menu items array, and are
configured through setupWidget(). Menu
selections generate commands, which are propagated to registered
commanders through the Commander Chain.
We’ll cover these three widgets in the next section on Menu
widgets.
The Submenu shares many of the model properties with Menu widgets, but is instantiated through a direct function call and is handled differently. The Submenu widget will be addressed fully in its own section later in the chapter.
The System UI includes another menu, called the Connection menu ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access