forked from flipperdevices/flipperzero-firmware
-
-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from leedave/feature/xremote_edit
Started on Edit Menu for Remote Items
- Loading branch information
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "../xremote.h" | ||
|
||
enum SubmenuIndexEdit { | ||
SubmenuIndexRename = 10, | ||
SubmenuIndexDelete, | ||
}; | ||
|
||
void xremote_scene_edit_item_submenu_callback(void* context, uint32_t index) { | ||
XRemote* app = context; | ||
view_dispatcher_send_custom_event(app->view_dispatcher, index); | ||
} | ||
|
||
void xremote_scene_edit_item_on_enter(void* context) | ||
{ | ||
XRemote* app = context; | ||
submenu_add_item(app->editmenu, "Rename", SubmenuIndexRename, xremote_scene_edit_item_submenu_callback, app); | ||
submenu_add_item(app->editmenu, "Delete", SubmenuIndexDelete, xremote_scene_edit_item_submenu_callback, app); | ||
|
||
submenu_set_selected_item(app->editmenu, scene_manager_get_scene_state(app->scene_manager, XRemoteSceneMenu)); | ||
|
||
view_dispatcher_switch_to_view(app->view_dispatcher, XRemoteViewIdEditItem); | ||
} | ||
|
||
bool xremote_scene_edit_item_on_event(void* context, SceneManagerEvent event) | ||
{ | ||
UNUSED(context); | ||
UNUSED(event); | ||
return 0; | ||
} | ||
|
||
void xremote_scene_edit_item_on_exit(void* context) | ||
{ | ||
UNUSED(context); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters