Module menu

Module menu 

Source
Expand description

On-screen menu policy shared by every display tracker.

The model is a tree three levels deep: a top level that reads, a Level::Settings list that groups the subsystems, and one list per subsystem holding the settings that change something. Each level is a wrapping list of MenuItems with a confirmation page in front of the destructive entries. Each board enables the subset it can actually perform via MenuItems; navigation skips whatever is not enabled, so the same code drives a two-item Heltec menu and a full T-Echo tree without either firmware knowing the other exists.

Depth is fixed and known here rather than discovered at runtime, so the cursor is one MenuItem and nothing else: an item knows its own level, and a level knows the entry that opens it. That keeps UiModel Copy, which the display tasks rely on.

The top level is a set of pages the user walks between: each of its three entries takes the whole panel while the cursor is on it. Every level below it is a list, and reading an entry there takes a Select, which opens a Page::Detail. Reading in place is a property of the level rather than of the entry, and the top level is the exception — a submenu that answered a question the moment the cursor crossed it would make walking the list a way of asking questions.

MenuItem::Status is the home item and is always enabled: it is where boot starts, where an activated item returns to, and where the display-attention lapse sends the user back to (see crate::attention).

Structs§

MenuItems
The set of menu items a board enables.
UiModel
The menu state machine.

Enums§

EntryKind
What an entry does when it is selected.
Level
One list in the tree.
MenuItem
An entry in the menu.
Page
The screen currently being shown.
ToggleId
Which setting a EntryKind::Toggle entry flips.
UiEffect
Something the firmware should do as a result of a selection.
UiInput
One resolved navigation gesture.
UiNotice
A transient result message shown on the status page.