pull/4/head
DiSlord 5 years ago
parent 635f4ffd59
commit ca6d982271

31
ui.c

@ -1718,13 +1718,13 @@ draw_menu_buttons(const menuitem_t *menu)
continue; continue;
if (MT_MASK(menu[i].type) == MT_NONE) if (MT_MASK(menu[i].type) == MT_NONE)
break; break;
// Change area update size for form and menu // Change area update size for form and menu (not need, apply on menu back, or menu select)
if (i == 0 && ui_mode == UI_MENU){ // if (i == 0 && ui_mode == UI_MENU){
if (menu[i].type & MT_FORM) // if (menu[i].type & MT_FORM)
area_width = 0; // area_width = 0;
else // else
area_width = AREA_WIDTH_NORMAL - MENU_BUTTON_WIDTH; // area_width = AREA_WIDTH_NORMAL - MENU_BUTTON_WIDTH;
} // }
button.icon = BUTTON_ICON_NONE; button.icon = BUTTON_ICON_NONE;
// Border width // Border width
button.border = MENU_BUTTON_BORDER; button.border = MENU_BUTTON_BORDER;
@ -1802,6 +1802,12 @@ draw_menu_buttons(const menuitem_t *menu)
} }
y += MENU_BUTTON_HEIGHT; y += MENU_BUTTON_HEIGHT;
} }
// Not erase Form menu (used full screen clear)
if (menu[i].type & MT_FORM)
return;
// Cleanup other buttons (less flicker)
for (; i < MENU_BUTTON_MAX; i++, y+=MENU_BUTTON_HEIGHT)
ili9341_fill(LCD_WIDTH-MENU_BUTTON_WIDTH, y, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT, DEFAULT_BG_COLOR);
} }
static void static void
@ -1856,11 +1862,12 @@ draw_menu(void)
static void static void
erase_menu_buttons(void) erase_menu_buttons(void)
{ {
// Not need, screen redraw in all cases
// ili9341_fill(area_width, 0, LCD_WIDTH - area_width, area_height, DEFAULT_BG_COLOR); // ili9341_fill(area_width, 0, LCD_WIDTH - area_width, area_height, DEFAULT_BG_COLOR);
if (current_menu_is_form()) // if (current_menu_is_form())
ili9341_fill(OFFSETX, 0,LCD_WIDTH-OFFSETX, MENU_BUTTON_HEIGHT*MENU_BUTTON_MAX, DEFAULT_BG_COLOR); // ili9341_fill(OFFSETX, 0,LCD_WIDTH-OFFSETX, MENU_BUTTON_HEIGHT*MENU_BUTTON_MAX, DEFAULT_BG_COLOR);
else // else
ili9341_fill(LCD_WIDTH-MENU_BUTTON_WIDTH, 0, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT*MENU_BUTTON_MAX, DEFAULT_BG_COLOR); // ili9341_fill(LCD_WIDTH-MENU_BUTTON_WIDTH, 0, MENU_BUTTON_WIDTH, MENU_BUTTON_HEIGHT*MENU_BUTTON_MAX, DEFAULT_BG_COLOR);
draw_frequencies(); draw_frequencies();
} }
@ -2028,7 +2035,7 @@ ui_mode_keypad(int _keypad_mode)
ui_mode = UI_KEYPAD; ui_mode = UI_KEYPAD;
area_width = AREA_WIDTH_NORMAL - MENU_BUTTON_WIDTH; area_width = AREA_WIDTH_NORMAL - MENU_BUTTON_WIDTH;
area_height = HEIGHT - 32; area_height = HEIGHT - NUM_INPUT_HEIGHT;
if (!current_menu_is_form()) if (!current_menu_is_form())
draw_menu(); draw_menu();
draw_keypad(); draw_keypad();

Loading…
Cancel
Save

Powered by TurnKey Linux.