Skip to content

Commit

Permalink
add submenu docs
Browse files Browse the repository at this point in the history
  • Loading branch information
forntoh committed Sep 30, 2024
1 parent b6e76be commit d17c100
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
File renamed without changes
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"**": ["sidebar_main_nav_links.html", "sidebar_toc.html"]
}
html_permalinks_icon = Icons.permalinks_icon
html_logo = "../_static/lcdmenu.svg"
html_favicon = "../_static/lcdmenu.svg"
html_logo = "../assets/lcdmenu.svg"
html_favicon = "../assets/lcdmenu.svg"
html_theme_options = {
'show_scrolltop': True,
'show_prev_next': True,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions docs/source/overview/deep-dive/submenu.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Sub-menu item
-------------

The sub-menu item is a menu item that opens a new menu screen when selected.
It is used to create a hierarchical menu structure with multiple levels of navigation.

This can be useful for organizing menu items into categories or sub-menus, making it easier for users to navigate through the menu system.

A sub-menu item can be created using the following syntax:

You first need to define the sub-menu screen with the desired menu items:

.. code-block:: cpp
MENU_SCREEN(subMenuScreen, subMenuItems,
ITEM_BASIC("Sub-item 1"),
ITEM_BASIC("Sub-item 2"),
ITEM_BASIC("Sub-item 3"),
ITEM_BASIC("Sub-item 4"));
Then you can create a sub-menu item entry that links to the sub-menu screen in the parent menu:

.. code-block:: cpp
// ... More menu items
ITEM_SUBMENU("Sub-menu 1", subMenuScreen)
// ... More menu items
When the ``Sub-menu 1`` menu item is selected, the sub-menu screen will be displayed, showing the list of sub-items.

.. image:: images/item-submenu.gif
:alt: Example of a sub-menu item

You can create multiple levels of sub-menus by nesting sub-menu items within other sub-menu screens.

Find more information about the sub-menu item in the :doc:`API reference </reference/api/ItemSubMenu>`.

0 comments on commit d17c100

Please sign in to comment.