mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
More menuexternal fixes
This commit is contained in:
@@ -104,7 +104,7 @@ static void loader_menu_build_menu(LoaderMenuApp* app, LoaderMenu* menu) {
|
||||
app->primary_menu,
|
||||
FLIPPER_EXTERNAL_APPS[i].name,
|
||||
FLIPPER_EXTERNAL_APPS[i].icon,
|
||||
(uint32_t)FLIPPER_EXTERNAL_APPS[i].path,
|
||||
(uint32_t)FLIPPER_EXTERNAL_APPS[i].name,
|
||||
loader_menu_apps_callback,
|
||||
(void*)menu);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ static void loader_menu_build_menu(LoaderMenuApp* app, LoaderMenu* menu) {
|
||||
ext_main_app->name,
|
||||
ext_main_app->icon,
|
||||
(uint32_t)ext_main_app->path,
|
||||
loader_menu_callback,
|
||||
loader_menu_apps_callback,
|
||||
(void*)menu);
|
||||
}
|
||||
furi_record_close(RECORD_LOADER);
|
||||
|
||||
@@ -5,15 +5,9 @@
|
||||
static void
|
||||
desktop_settings_scene_keybinds_action_submenu_callback(void* context, uint32_t index) {
|
||||
DesktopSettingsApp* app = context;
|
||||
DesktopSettingsAppKeybindActionType action_type = scene_manager_get_scene_state(
|
||||
app->scene_manager, DesktopSettingsAppSceneKeybindsActionType);
|
||||
char* keybind = desktop_settings_app_get_keybind(app);
|
||||
|
||||
if(action_type == DesktopSettingsAppKeybindActionTypeMainApp) {
|
||||
strncpy(keybind, FLIPPER_APPS[index].name, MAX_KEYBIND_LENGTH);
|
||||
} else if(action_type == DesktopSettingsAppKeybindActionTypeMoreActions) {
|
||||
strncpy(keybind, EXTRA_KEYBINDS[index], MAX_KEYBIND_LENGTH);
|
||||
}
|
||||
strncpy(keybind, (const char*)index, MAX_KEYBIND_LENGTH);
|
||||
|
||||
DESKTOP_KEYBINDS_SAVE(&app->desktop->keybinds, sizeof(app->desktop->keybinds));
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
@@ -31,17 +25,30 @@ void desktop_settings_scene_keybinds_action_on_enter(void* context) {
|
||||
app->scene_manager, DesktopSettingsAppSceneKeybindsActionType);
|
||||
|
||||
if(action_type == DesktopSettingsAppKeybindActionTypeMainApp) {
|
||||
for(size_t i = 0; i < FLIPPER_EXTERNAL_APPS_COUNT; i++) {
|
||||
submenu_add_item(
|
||||
submenu,
|
||||
FLIPPER_EXTERNAL_APPS[i].name,
|
||||
(uint32_t)FLIPPER_EXTERNAL_APPS[i].name,
|
||||
desktop_settings_scene_keybinds_action_submenu_callback,
|
||||
app);
|
||||
|
||||
// Select keybind item in submenu
|
||||
if(!strncmp(FLIPPER_EXTERNAL_APPS[i].name, keybind, MAX_KEYBIND_LENGTH)) {
|
||||
pre_select_item = FLIPPER_EXTERNAL_APPS[i].name;
|
||||
}
|
||||
}
|
||||
for(size_t i = 0; i < FLIPPER_APPS_COUNT; i++) {
|
||||
submenu_add_item(
|
||||
submenu,
|
||||
FLIPPER_APPS[i].name,
|
||||
i,
|
||||
(uint32_t)FLIPPER_APPS[i].name,
|
||||
desktop_settings_scene_keybinds_action_submenu_callback,
|
||||
app);
|
||||
|
||||
// Select keybind item in submenu
|
||||
if(!strncmp(FLIPPER_APPS[i].name, keybind, MAX_KEYBIND_LENGTH)) {
|
||||
pre_select_item = i;
|
||||
pre_select_item = FLIPPER_APPS[i].name;
|
||||
}
|
||||
}
|
||||
} else if(action_type == DesktopSettingsAppKeybindActionTypeMoreActions) {
|
||||
@@ -49,13 +56,13 @@ void desktop_settings_scene_keybinds_action_on_enter(void* context) {
|
||||
submenu_add_item(
|
||||
submenu,
|
||||
EXTRA_KEYBINDS[i],
|
||||
i,
|
||||
(uint32_t)EXTRA_KEYBINDS[i],
|
||||
desktop_settings_scene_keybinds_action_submenu_callback,
|
||||
app);
|
||||
|
||||
// Select keybind item in submenu
|
||||
if(!strncmp(EXTRA_KEYBINDS[i], keybind, MAX_KEYBIND_LENGTH)) {
|
||||
pre_select_item = i;
|
||||
pre_select_item = EXTRA_KEYBINDS[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user