diff --git a/radio/src/bitmaps/Horus/mask_index_shadow.png b/radio/src/bitmaps/Horus/mask_index_shadow.png new file mode 100644 index 000000000..ba2a278a2 Binary files /dev/null and b/radio/src/bitmaps/Horus/mask_index_shadow.png differ diff --git a/radio/src/gui/Horus/menus.h b/radio/src/gui/Horus/menus.h index b8164a04d..7ab3fc062 100644 --- a/radio/src/gui/Horus/menus.h +++ b/radio/src/gui/Horus/menus.h @@ -216,7 +216,7 @@ bool isInputSourceAvailable(int source); #define CURSOR_ON_LINE() (m_posHorz<0) #define CHECK_FLAG_NO_SCREEN_INDEX 1 -void check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint16_t scrollbar_X, uint8_t flags=0); +bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t maxrow, uint16_t scrollbar_X, uint8_t flags=0); void check_simple(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, vertpos_t maxrow, uint16_t scrollbar_X); void check_submenu_simple(check_event_t event, uint8_t maxrow, uint16_t scrollbar_X); void title(const pm_char * s); @@ -235,8 +235,8 @@ void drawMenuTemplate(const char *title, evt_t event, int pageIndex=0, int pageC #define MENU(title, tab, menu, lines_count, scrollbar_X, ...) \ if (event == EVT_ENTRY || event == EVT_ENTRY_UP) TRACE("Menu %s displayed ...", title); \ MENU_TAB(__VA_ARGS__); \ + if (!MENU_CHECK(tab, menu, lines_count, scrollbar_X)) return; \ drawMenuTemplate(title, event, menu, DIM(tab)); \ - MENU_CHECK(tab, menu, lines_count, scrollbar_X) #define MENU_FLAGS(title, tab, menu, flags, lines_count, scrollbar_X, ...) \ MENU_TAB(__VA_ARGS__); \ diff --git a/radio/src/gui/Horus/navigation.cpp b/radio/src/gui/Horus/navigation.cpp index 8ec6c69e0..d001cae82 100644 --- a/radio/src/gui/Horus/navigation.cpp +++ b/radio/src/gui/Horus/navigation.cpp @@ -216,7 +216,7 @@ int checkIncDec(evt_t event, int val, int i_min, int i_max, unsigned int i_flags #define INC(val, min, max) if (valmin) {val--;} else {val=max;} -void check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint16_t scrollbar_X, uint8_t flags) +bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, const pm_uint8_t *horTab, uint8_t horTabMax, vertpos_t rowcount, uint16_t scrollbar_X, uint8_t flags) { vertpos_t l_posVert = m_posVert; horzpos_t l_posHorz = m_posHorz; @@ -246,7 +246,7 @@ void check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t if (cc != curr) { chainMenu((MenuFuncP)pgm_read_adr(&menuTab[cc])); - return; + return false; } } @@ -315,7 +315,6 @@ void check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t case EVT_KEY_REPT(KEY_LEFT): DEC(l_posHorz, 0, maxcol); break; - break; case EVT_ROTARY_RIGHT: if (s_editMode != 0) break; @@ -445,6 +444,8 @@ void check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t m_posVert = l_posVert; m_posHorz = l_posHorz; + + return true; } void check_simple(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t menuTabSize, vertpos_t rowcount, uint16_t scrollbar_X) diff --git a/radio/src/gui/Horus/widgets.cpp b/radio/src/gui/Horus/widgets.cpp index bda3da69e..70a3566a6 100644 --- a/radio/src/gui/Horus/widgets.cpp +++ b/radio/src/gui/Horus/widgets.cpp @@ -170,6 +170,7 @@ const uint8_t LBM_LUA_SCRIPTS_ICON[] = { const uint8_t LBM_TELEMETRY_ICON[] = { #include "../../bitmaps/Horus/mask_telemetry.lbm" }; + const uint8_t * const LBM_MODEL_ICONS[] = { LBM_MODEL_SETUP_ICON, CASE_HELI(LBM_HELI_ICON) @@ -187,8 +188,28 @@ const uint8_t * const LBM_MODEL_ICONS[] = { LBM_TELEMETRY_ICON }; -const uint8_t LBM_BALL[] = { -#include "../../bitmaps/Horus/mask_ball.lbm" +const uint8_t LBM_TOP_POLYGON[] = { +#include "../../bitmaps/Horus/mask_top_polygon.lbm" +}; + +const uint8_t LBM_DOT[] = { +#include "../../bitmaps/Horus/mask_dot.lbm" +}; + +const uint8_t LBM_CURRENT_BG[] = { +#include "../../bitmaps/Horus/mask_current_bg.lbm" +}; + +const uint8_t LBM_CURRENT_SHADOW[] = { +#include "../../bitmaps/Horus/mask_index_shadow.lbm" +}; + +const uint8_t LBM_CURRENT_DOT[] = { +#include "../../bitmaps/Horus/mask_current_dot.lbm" +}; + +const uint8_t LBM_MENU_MODEL[] = { +#include "../../bitmaps/Horus/mask_menu_model.lbm" }; #define MENU_ICONS_SPACING 34 @@ -197,17 +218,29 @@ void drawMenuTemplate(const char *name, evt_t event, int pageIndex, int pageCoun { // clear the screen lcdDrawFilledRect(0, 0, LCD_W, MENU_HEADER_HEIGHT, HEADER_BGCOLOR); + lcdDrawFilledRect(0, MENU_HEADER_HEIGHT, LCD_W, MENU_TITLE_TOP-MENU_HEADER_HEIGHT, TEXT_BGCOLOR); lcdDrawFilledRect(0, MENU_TITLE_TOP, LCD_W, MENU_TITLE_HEIGHT, TITLE_BGCOLOR); lcdDrawFilledRect(0, MENU_BODY_TOP, LCD_W, MENU_BODY_HEIGHT, TEXT_BGCOLOR); lcdDrawFilledRect(0, MENU_FOOTER_TOP, LCD_W, MENU_FOOTER_HEIGHT, HEADER_BGCOLOR); - lcdDrawFilledRect(58+pageIndex*MENU_ICONS_SPACING-11, 0, 36, MENU_HEADER_HEIGHT, TITLE_BGCOLOR); + lcdDrawBitmapPattern(0, 0, LBM_TOP_POLYGON, TITLE_BGCOLOR); + + lcdDrawBitmapPattern(5, 5, LBM_MENU_MODEL, MENU_TITLE_COLOR); + + if (m_posVert < 0) { + lcdDrawBitmapPattern(58+pageIndex*MENU_ICONS_SPACING-11, 0, LBM_CURRENT_BG, TITLE_BGCOLOR); + lcdDrawBitmapPattern(58+pageIndex*MENU_ICONS_SPACING-11, 0, LBM_CURRENT_SHADOW, TEXT_COLOR); + lcdDrawBitmapPattern(58+pageIndex*MENU_ICONS_SPACING, MENU_TITLE_TOP-9, LBM_CURRENT_DOT, MENU_TITLE_COLOR); + } + else { + lcdDrawFilledRect(58+pageIndex*MENU_ICONS_SPACING-11, 0, 36, MENU_HEADER_HEIGHT, TITLE_BGCOLOR); + lcdDrawBitmapPattern(58+pageIndex*MENU_ICONS_SPACING, MENU_TITLE_TOP-9, LBM_DOT, MENU_TITLE_COLOR); + } for (int i=0; i