Skip to content

Commit

Permalink
feat: hiding menu functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Otrebor671 committed Sep 5, 2024
1 parent af1f4f1 commit 0f3e292
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions firmware/main/modules/menus_module/menus_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,24 @@ bool menus_module_get_app_state() {
return app_state2.in_app;
}

void menus_module_set_menu(menu_idx_t menu_idx) {
keyboard_module_set_input_callback(menus_input_cb);
menus_ctx->current_menu = menus[get_menu_idx(menu_idx)].menu_idx;
menus_ctx->parent_menu_idx = menus[get_menu_idx(menu_idx)].parent_idx;
refresh_menus();
}

void menus_module_hide_menu(menu_idx_t menu_idx) {
menus[get_menu_idx(menu_idx)].is_visible = false;
}

void menus_module_reveal_menu(menu_idx_t menu_idx) {
menus[get_menu_idx(menu_idx)].is_visible = true;
}
void menus_module_refresh() {
refresh_menus();
}

void menus_module_begin() {
menus_ctx = calloc(1, sizeof(menus_manager_t));
menus_ctx->menus_count = sizeof(menus) / sizeof(menu_t);
Expand Down
4 changes: 4 additions & 0 deletions firmware/main/modules/menus_module/menus_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ void menus_module_restart();
void menus_module_exit_app();
void menus_module_screen_saver_run();
void menus_module_set_reset_screen(menu_idx_t menu);
void menus_module_set_menu(menu_idx_t menu_idx);
void menus_module_hide_menu(menu_idx_t menu_idx);
void menus_module_reveal_menu(menu_idx_t menu_idx);
void menus_module_refresh();

0 comments on commit 0f3e292

Please sign in to comment.