expo: Add a way to select settings

In some cases it is useful to provide a settings scene, or perhaps just
a button to change the layout. Add support for this.
This commit is contained in:
Simon Glass
2025-10-09 15:45:55 +01:00
parent f4e3c6f418
commit e94de63e6c
6 changed files with 12 additions and 1 deletions

View File

@@ -13,6 +13,7 @@
* enum boomenu_id_t - expo IDs for elements of the bootflow menu
*
* @OBJ_OTHER_LOGO: Second logo (separate from the U-Boot logo)
* @OBJ_SETTINGS: Select settings / change layout
*
* The ranges below are as follows:
*
@@ -47,6 +48,7 @@ enum boomenu_id_t {
OBJ_POINTER,
OBJ_AUTOBOOT,
OBJ_OTHER_LOGO,
OBJ_SETTINGS,
/* strings for menu items */
STR_LABEL = 100,

View File

@@ -314,6 +314,8 @@ int bootflow_menu_poll(struct expo *exp, int *seqp)
case EXPOACT_QUIT:
return -EPIPE;
case EXPOACT_CLICK:
if (act.select.id == OBJ_SETTINGS)
return -ECOMM; /* layout change request */
default:
return -EAGAIN;
}

View File

@@ -221,6 +221,7 @@ int cedit_do_action(struct expo *exp, struct scene *scn,
exp->done = true;
break;
case EXPOACT_CLICK:
case EXPOACT_SETTINGS:
/* not supported by cedit */
break;
}

View File

@@ -485,6 +485,9 @@ int scene_menu_send_key(struct scene *scn, struct scene_obj_menu *menu, int key,
log_debug("menu quit\n");
}
break;
case ' ':
event->type = EXPOACT_SETTINGS;
break;
case '0'...'9':
key_item = scene_menu_find_key(scn, menu, key);
if (key_item) {

View File

@@ -743,7 +743,8 @@ int bootflow_menu_start(struct bootstd_priv *std, bool text_mode,
* Return: 0 if a bootflow was chosen, -EAGAIN if nothing is chosen yet, -EPIPE
* if the user quit, -EREMCHG if the expo needs refreshing, -ERESTART if
* the user tried to move to a new selection but was unable (e.g. already
* at the top and tried to move up)
* at the top and tried to move up), -ECOMM if the user requests settings
* to be opened
*/
int bootflow_menu_poll(struct expo *exp, int *seqp);

View File

@@ -57,6 +57,7 @@ enum expo_id_t {
* the menu closed, @id indicates menu opened)
* @EXPOACT_QUIT: request to exit the menu
* @EXPOACT_CLICK: click on an object
* @EXPOACT_SETTINGS: select menu settings
*/
enum expoact_type {
EXPOACT_NONE,
@@ -70,6 +71,7 @@ enum expoact_type {
EXPOACT_REPOINT_OPEN,
EXPOACT_QUIT,
EXPOACT_CLICK,
EXPOACT_SETTINGS,
};
/**