UI: Add top and bottom lines

replace/6c1920ce593643672359e479d3932dd99e90a4b2
Federico Amedeo Izzo 2020-11-19 17:05:10 +01:00
rodzic 552a88ed4c
commit 0f0d6fe344
1 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -75,6 +75,8 @@
typedef struct layout_t typedef struct layout_t
{ {
uint16_t top_h;
uint16_t bottom_h;
point_t top_pos; point_t top_pos;
point_t line1_pos; point_t line1_pos;
point_t line2_pos; point_t line2_pos;
@ -90,6 +92,7 @@ typedef struct layout_t
layout_t layout; layout_t layout;
bool layout_ready = false; bool layout_ready = false;
color_t color_white = {255, 255, 255}; color_t color_white = {255, 255, 255};
color_t color_grey = {60, 60, 60};
layout_t _ui_calculateLayout() layout_t _ui_calculateLayout()
{ {
@ -172,6 +175,8 @@ layout_t _ui_calculateLayout()
layout_t new_layout = layout_t new_layout =
{ {
top_h,
bottom_h,
top_pos, top_pos,
line1_pos, line1_pos,
line2_pos, line2_pos,
@ -186,6 +191,14 @@ layout_t _ui_calculateLayout()
return new_layout; return new_layout;
} }
void _ui_drawBackground()
{
// Print top bar line of 1 pixel height
gfx_drawHLine(layout.top_h, 1, color_grey);
// Print bottom bar line of 1 pixel height
gfx_drawHLine(SCREEN_HEIGHT - layout.bottom_h - 1, 1, color_grey);
}
void _ui_drawTopBar() void _ui_drawTopBar()
{ {
// Print clock on top bar // Print clock on top bar
@ -224,6 +237,7 @@ void _ui_drawBottomBar()
void ui_drawMainScreen(state_t state) void ui_drawMainScreen(state_t state)
{ {
_ui_drawBackground();
_ui_drawTopBar(); _ui_drawTopBar();
_ui_drawVFO(state); _ui_drawVFO(state);
_ui_drawBottomBar(); _ui_drawBottomBar();