[FL-1217] Menu refactoring (#726)
* menu: remove dead code * loader: change views from modules instead of menu service * dolphin: start main menu with loader API * applications: don't start menu service * loader: add debug tools menu * gui modules: introduce menu model * loader: remove calls to menu service API * gui modules: implement menu module * loader: add menu view * gui menu: add animation * applications: remove menu service * gui modules: rename icon_menu -> menu * loader: clean up code * menu module: add documentation, format code * menu: remove unused parameter * desktop: use loader to launch primary menu * Applications: cleaner makefile app declaration. Loader: application autostart * Gui: cleanup menu and submenu API. Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -21,7 +21,6 @@ bool desktop_back_event_callback(void* context) {
|
||||
Desktop* desktop_alloc() {
|
||||
Desktop* desktop = furi_alloc(sizeof(Desktop));
|
||||
|
||||
desktop->menu_vm = furi_record_open("menu");
|
||||
desktop->gui = furi_record_open("gui");
|
||||
desktop->scene_thread = furi_thread_alloc();
|
||||
desktop->view_dispatcher = view_dispatcher_alloc();
|
||||
@@ -101,7 +100,6 @@ void desktop_free(Desktop* desktop) {
|
||||
furi_thread_free(desktop->scene_thread);
|
||||
|
||||
furi_record_close("menu");
|
||||
desktop->menu_vm = NULL;
|
||||
|
||||
free(desktop);
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <furi.h>
|
||||
#include <furi-hal.h>
|
||||
#include <menu/menu.h>
|
||||
#include <gui/gui.h>
|
||||
#include <gui/view_dispatcher.h>
|
||||
#include <gui/scene_manager.h>
|
||||
@@ -34,8 +33,6 @@ typedef enum {
|
||||
} DesktopViewEnum;
|
||||
|
||||
struct Desktop {
|
||||
// Menu
|
||||
ValueMutex* menu_vm;
|
||||
// Scene
|
||||
FuriThread* scene_thread;
|
||||
// GUI
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "../desktop_i.h"
|
||||
#include "../views/desktop_main.h"
|
||||
#include "applications.h"
|
||||
#include <loader/loader.h>
|
||||
#define MAIN_VIEW_DEFAULT (0UL)
|
||||
|
||||
static void desktop_switch_to_app(Desktop* desktop, const FlipperApplication* flipper_app) {
|
||||
@@ -48,8 +49,7 @@ const bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
switch(event.event) {
|
||||
case DesktopMainEventOpenMenu:
|
||||
with_value_mutex(
|
||||
desktop->menu_vm, (Menu * menu) { menu_ok(menu); });
|
||||
loader_show_menu();
|
||||
consumed = true;
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user