9#ifndef ASW_UI_CONTEXT_H
10#define ASW_UI_CONTEXT_H
Shared state for the UI system.
bool show_focus
Whether focus is shown. Root turns it on for keyboard and controller navigation and off when the mous...
Navigation navigation
Actions to read for focus navigation. Empty names use the built in keys.
Context()=default
Default constructor.
FocusManager focus
The focus manager.
Theme theme
The current UI theme.
Manages focus navigation for UI widgets.
void focus_prev(Context &ctx)
Move focus to the previous focusable widget.
void focus_dir(Context &ctx, int dx, int dy)
Move focus in a direction based on widget positions.
std::vector< Widget * > _focusables
bool focus_start(Context &ctx)
Focus default_focus, or the first focusable widget, when nothing has focus.
std::optional< float > _lane_y
void set_focus(Context &ctx, Widget *w)
Set focus to a specific widget.
std::optional< float > _lane_x
Widget * default_focus
Widget focused by the first navigation press when nothing has focus. The first focusable widget when ...
void focus_next(Context &ctx)
Move focus to the next focusable widget.
Widget * focused() const
Get the currently focused widget.
void rebuild(Context &ctx, Widget &root)
Root container that manages the UI tree, input, and rendering.
Action based navigation for the ASW UI module.
Action names the UI reads for focus navigation, see asw/modules/action.h.
Theme configuration for UI elements.
UI theme configuration for the ASW UI module.