From fddbe6302876826b99db33f97e18f5be4b4f99a5 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Fri, 3 Apr 2020 13:13:07 +0200 Subject: [PATCH] Menu rework is done. --- UI.hpp | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/UI.hpp b/UI.hpp index f2e4478..02305e2 100644 --- a/UI.hpp +++ b/UI.hpp @@ -663,18 +663,27 @@ void lcdml_menu_control(void) #endif encoderDir[ENC_L].ButtonShort(true); inside_menu = false; - if (LCDML.FUNC_getID() == VOLUME_MENU_ID) + switch (LCDML.FUNC_getID()) { - if (last_menu < 0xff && inside_menu == true) - LCDML.OTHER_jumpToID(last_menu); - else - { - LCDML.OTHER_setCursorToID(last_cursor); - LCDML.DISP_update(); - } + case VOLUME_MENU_ID: + if (last_menu < 0xff && inside_menu == true) + LCDML.OTHER_jumpToID(last_menu); + else + { + LCDML.OTHER_setCursorToID(last_cursor); + LCDML.DISP_update(); + } + break; + case PATCH_MENU_ID1: +#if defined(PATCH_MENU_ID2) + case PATCH_MENU_ID2: +#endif + if (last_cursor == 0) + LCDML.MENU_goRoot(); + break; + default: + LCDML.BT_quit(); } - else - LCDML.BT_quit(); } } }