Improved indentation in _ui_drawMacroMenu()

pull/238/head
Silvano Seva 2023-12-27 16:31:38 +01:00
rodzic c3f1ec0ea1
commit f771d4ec06
2 zmienionych plików z 170 dodań i 158 usunięć

Wyświetl plik

@ -1055,6 +1055,7 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
#endif // UI_NO_KEYBOARD
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_RIGHT,
yellow_fab413, "3 ");
if (last_state.channel.mode == OPMODE_FM)
{
char encdec_str[9] = { 0 };
@ -1077,15 +1078,18 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
gfx_print(layout.line1_pos, layout.top_font, TEXT_ALIGN_CENTER,
color_white, encdec_str);
}
// Second row
// Calculate symmetric second row position, line2_pos is asymmetric like main screen
point_t pos_2 = {layout.line1_pos.x, layout.line1_pos.y +
(layout.line3_large_pos.y - layout.line1_pos.y)/2};
#if defined(UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 3)
#endif // UI_NO_KEYBOARD
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_LEFT,
yellow_fab413, "4");
if (last_state.channel.mode == OPMODE_FM)
{
char bw_str[12] = { 0 };
@ -1101,6 +1105,7 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
snprintf(bw_str, 12, " BW 25 ");
break;
}
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_LEFT,
color_white, bw_str);
}
@ -1110,11 +1115,13 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
color_white, " ");
}
#if defined(UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 4)
#endif // UI_NO_KEYBOARD
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_CENTER,
yellow_fab413, "5");
char mode_str[12] = "";
switch(last_state.channel.mode)
{
@ -1128,8 +1135,10 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
snprintf(mode_str, 12," M17");
break;
}
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_CENTER,
color_white, mode_str);
#if defined(UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 5)
#endif // UI_NO_KEYBOARD
@ -1137,6 +1146,7 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
yellow_fab413, "6 ");
gfx_print(pos_2, layout.top_font, TEXT_ALIGN_RIGHT,
color_white, "%.1gW", dBmToWatt(last_state.channel.power));
// Third row
#if defined(UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 6)
@ -1150,6 +1160,7 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
color_white, " %5d",
state.settings.brightness);
#endif
#if defined(UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 7)
#endif // UI_NO_KEYBOARD
@ -1159,6 +1170,7 @@ bool _ui_drawMacroMenu(ui_state_t* ui_state)
gfx_print(layout.line3_large_pos, layout.top_font, TEXT_ALIGN_CENTER,
color_white, " B+");
#endif
#if defined(UI_NO_KEYBOARD)
if (ui_state->macro_menu_selected == 8)
#endif // UI_NO_KEYBOARD