Expand description
The status-line data types — StatusItem, StatusDef — plus a
fluent builder. The StatusLine view (drawing,
mouse dispatch, hotkey accelerators, command graying) lives in
status_line.
A StatusItem is one entry: a label, an optional accelerator key, and the
command it emits. A StatusDef groups the items shown for a particular
set of help contexts (HelpCtxRange); the status line walks its defs and
shows the first one whose range matches the current help context.
§Hidden hotkey bindings
A StatusItem with no text (StatusItem::text == None) displays
nothing and consumes no horizontal space, but its accelerator still
fires its command — an invisible global hotkey (e.g. Shift-Del → Cut). Draw
and mouse-hit-test skip such items; the keyboard accelerator does not.
§Which help contexts a def applies to
A StatusDef selects its items based on the current help context. Because
a HelpCtx here is a namespaced &'static str with no ordering,
HelpCtxRange is a small matcher rather than a numeric range: the universal
def is HelpCtxRange::All (matches anything), and the rare context-split
case is an explicit membership set (HelpCtxRange::OneOf). It stays
Clone + PartialEq + Eq, like Menu.
Guide: Menus, status line & help.
§Turbo Vision heritage
Ports TStatusItem and TStatusDef (menus.h, tstatusl.cpp). The singly
linked lists become Vecs, and the numeric help-context range becomes
HelpCtxRange because help contexts are now namespaced strings rather than
integers (deviation D1).
Re-exports§
pub use status_line::StatusColors;pub use status_line::StatusLine;
Modules§
- status_
line - The bottom
StatusLine— a one-rowViewat the bottom of the screen showing the items of the help-context-selectedStatusDef.
Structs§
- Status
Def - A status-line definition: the items shown for a
rangeof help contexts. - Status
DefList Builder - A fluent builder for the
Vec<StatusDef>aStatusLineowns. - Status
Item - A single status-line entry: a label, an optional accelerator, and a command.
- Status
Items Builder - A fluent builder for one def’s
Vec<StatusItem>.
Enums§
- Help
CtxRange - Which help contexts a
StatusDefapplies to (see the module docs).