diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d214b699..874161995 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Archive: Setting to show dynamic path in file browser statusbar (#322 by @956MB) - CLI: Add `clear` and `cls` commands, add `did you mean ...?` command suggestion (#342 by @dexvleads) - Main Menu: Add coverflow menu style (#314 by @CodyTolene) +- MNTM Settings: Add Menu Style submenu for easier selection (#359 by @jaylikesbunda) - BadKB: Added german Mac keyboard Layout (#325 by @Cloudy261) - UL: Sub-GHz: Jolly Motors support with add manually (by @pkooiman & @xMasterX) - OFW: Desktop: Add winter animations (by @Astrrra) diff --git a/applications/main/momentum_app/scenes/momentum_app_scene_config.h b/applications/main/momentum_app/scenes/momentum_app_scene_config.h index c9eb6e996..2c18840b4 100644 --- a/applications/main/momentum_app/scenes/momentum_app_scene_config.h +++ b/applications/main/momentum_app/scenes/momentum_app_scene_config.h @@ -6,6 +6,7 @@ ADD_SCENE(momentum_app, interface_mainmenu, InterfaceMainmenu) ADD_SCENE(momentum_app, interface_mainmenu_add, InterfaceMainmenuAdd) ADD_SCENE(momentum_app, interface_mainmenu_add_main, InterfaceMainmenuAddMain) ADD_SCENE(momentum_app, interface_mainmenu_reset, InterfaceMainmenuReset) +ADD_SCENE(momentum_app, interface_mainmenu_style, InterfaceMainmenuStyle) ADD_SCENE(momentum_app, interface_lockscreen, InterfaceLockscreen) ADD_SCENE(momentum_app, interface_statusbar, InterfaceStatusbar) ADD_SCENE(momentum_app, interface_filebrowser, InterfaceFilebrowser) diff --git a/applications/main/momentum_app/scenes/momentum_app_scene_interface_graphics_pack.c b/applications/main/momentum_app/scenes/momentum_app_scene_interface_graphics_pack.c index a14aca398..da590c2eb 100644 --- a/applications/main/momentum_app/scenes/momentum_app_scene_interface_graphics_pack.c +++ b/applications/main/momentum_app/scenes/momentum_app_scene_interface_graphics_pack.c @@ -2,14 +2,7 @@ void momentum_app_scene_interface_graphics_pack_submenu_callback(void* context, uint32_t index) { MomentumApp* app = context; - strlcpy( - momentum_settings.asset_pack, - index == 0 ? "" : *CharList_get(app->asset_pack_names, index - 1), - ASSET_PACKS_NAME_LEN); - app->asset_pack_index = index; - app->save_settings = true; - app->apply_pack = true; - scene_manager_previous_scene(app->scene_manager); + view_dispatcher_send_custom_event(app->view_dispatcher, index); } void momentum_app_scene_interface_graphics_pack_on_enter(void* context) { @@ -36,11 +29,19 @@ void momentum_app_scene_interface_graphics_pack_on_enter(void* context) { } bool momentum_app_scene_interface_graphics_pack_on_event(void* context, SceneManagerEvent event) { - UNUSED(context); + MomentumApp* app = context; bool consumed = false; if(event.type == SceneManagerEventTypeCustom) { consumed = true; + strlcpy( + momentum_settings.asset_pack, + event.event == 0 ? "" : *CharList_get(app->asset_pack_names, event.event - 1), + ASSET_PACKS_NAME_LEN); + app->asset_pack_index = event.event; + app->save_settings = true; + app->apply_pack = true; + scene_manager_previous_scene(app->scene_manager); } return consumed; diff --git a/applications/main/momentum_app/scenes/momentum_app_scene_interface_mainmenu.c b/applications/main/momentum_app/scenes/momentum_app_scene_interface_mainmenu.c index afad8f7d2..4743e08b3 100644 --- a/applications/main/momentum_app/scenes/momentum_app_scene_interface_mainmenu.c +++ b/applications/main/momentum_app/scenes/momentum_app_scene_interface_mainmenu.c @@ -77,8 +77,8 @@ void momentum_app_scene_interface_mainmenu_on_enter(void* context) { MenuStyleCount, momentum_app_scene_interface_mainmenu_menu_style_changed, app); - variable_item_set_current_value_index(item, momentum_settings.menu_style); variable_item_set_current_value_text(item, menu_style_names[momentum_settings.menu_style]); + variable_item_set_current_value_index(item, momentum_settings.menu_style); variable_item_list_add(var_item_list, "Reset Menu", 0, NULL, app); @@ -127,6 +127,9 @@ bool momentum_app_scene_interface_mainmenu_on_event(void* context, SceneManagerE app->scene_manager, MomentumAppSceneInterfaceMainmenu, event.event); consumed = true; switch(event.event) { + case VarItemListIndexMenuStyle: + scene_manager_next_scene(app->scene_manager, MomentumAppSceneInterfaceMainmenuStyle); + break; case VarItemListIndexResetMenu: scene_manager_next_scene(app->scene_manager, MomentumAppSceneInterfaceMainmenuReset); break; diff --git a/applications/main/momentum_app/scenes/momentum_app_scene_interface_mainmenu_style.c b/applications/main/momentum_app/scenes/momentum_app_scene_interface_mainmenu_style.c new file mode 100644 index 000000000..ec373fa6b --- /dev/null +++ b/applications/main/momentum_app/scenes/momentum_app_scene_interface_mainmenu_style.c @@ -0,0 +1,46 @@ +#include "../momentum_app.h" + +// Reference the menu style names from mainmenu scene +extern const char* const menu_style_names[MenuStyleCount]; + +void momentum_app_scene_interface_mainmenu_style_submenu_callback(void* context, uint32_t index) { + MomentumApp* app = context; + view_dispatcher_send_custom_event(app->view_dispatcher, index); +} + +void momentum_app_scene_interface_mainmenu_style_on_enter(void* context) { + MomentumApp* app = context; + Submenu* submenu = app->submenu; + + for(size_t i = 0; i < MenuStyleCount; i++) { + submenu_add_item( + submenu, + menu_style_names[i], + i, + momentum_app_scene_interface_mainmenu_style_submenu_callback, + app); + } + + submenu_set_header(submenu, "Choose Menu Style:"); + submenu_set_selected_item(submenu, momentum_settings.menu_style); + view_dispatcher_switch_to_view(app->view_dispatcher, MomentumAppViewSubmenu); +} + +bool momentum_app_scene_interface_mainmenu_style_on_event(void* context, SceneManagerEvent event) { + MomentumApp* app = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + consumed = true; + momentum_settings.menu_style = event.event; + app->save_settings = true; + scene_manager_previous_scene(app->scene_manager); + } + + return consumed; +} + +void momentum_app_scene_interface_mainmenu_style_on_exit(void* context) { + MomentumApp* app = context; + submenu_reset(app->submenu); +}