Skip to content

Commit

Permalink
Use for loop for selecting the first item
Browse files Browse the repository at this point in the history
  • Loading branch information
Master92 committed Nov 10, 2023
1 parent 90e4881 commit ed58405
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/ui/ui_main_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ void submenu_enter(void) {

if (pp->p_arr.max) {
// if we have selectable entries, select the first selectable one
pp->p_arr.cur = -1;
while (!lv_obj_has_flag(pp->p_arr.panel[++pp->p_arr.cur], FLAG_SELECTABLE));
for (pp->p_arr.cur = 0; !lv_obj_has_flag(pp->p_arr.panel[pp->p_arr.cur], FLAG_SELECTABLE); ++pp->p_arr.cur);
set_select_item(&pp->p_arr, pp->p_arr.cur);
}

Expand Down

0 comments on commit ed58405

Please sign in to comment.