diff --git a/openrtx/include/core/ui.h b/openrtx/include/core/ui.h index 5e7ba2ea..fc0344d0 100644 --- a/openrtx/include/core/ui.h +++ b/openrtx/include/core/ui.h @@ -30,12 +30,10 @@ void ui_init(); /** - * This function writes the OpenRTX splash screen image into the framebuffer. - * - * @param centered: if true the logo will be printed at the center of - * the screen, otherwise it will be printed at the top of the screen. + * This function writes the OpenRTX splash screen image into the framebuffer + * centered in the screen space. */ -void ui_drawSplashScreen(bool centered); +void ui_drawSplashScreen(); /** * This function updates the local copy of the radio state diff --git a/openrtx/src/core/openrtx.c b/openrtx/src/core/openrtx.c index e2f8f35a..98994faa 100644 --- a/openrtx/src/core/openrtx.c +++ b/openrtx/src/core/openrtx.c @@ -69,7 +69,7 @@ void openrtx_init() // Display splash screen, turn on backlight after a suitable time to // hide random pixels during render process - ui_drawSplashScreen(true); + ui_drawSplashScreen(); gfx_render(); sleepFor(0u, 30u); display_setBacklightLevel(state.settings.brightness); diff --git a/openrtx/src/ui/default/ui.c b/openrtx/src/ui/default/ui.c index 47258f7c..06d8132f 100644 --- a/openrtx/src/ui/default/ui.c +++ b/openrtx/src/ui/default/ui.c @@ -1238,17 +1238,24 @@ void ui_init() ui_state = (const struct ui_state_t){ 0 }; } -void ui_drawSplashScreen(bool centered) +void ui_drawSplashScreen() { gfx_clearScreen(); - point_t splash_origin = {0,0}; - if(centered) - splash_origin.y = SCREEN_HEIGHT / 2 - 6; - else - splash_origin.y = SCREEN_HEIGHT / 5; - gfx_print(splash_origin, FONT_SIZE_12PT, TEXT_ALIGN_CENTER, yellow_fab413, - "O P N\nR T X"); + #if SCREEN_HEIGHT > 64 + static const point_t logo_orig = {0, (SCREEN_HEIGHT / 2) - 6}; + static const point_t call_orig = {0, SCREEN_HEIGHT - 8}; + static const fontSize_t logo_font = FONT_SIZE_12PT; + static const fontSize_t call_font = FONT_SIZE_8PT; + #else + static const point_t logo_orig = {0, 19}; + static const point_t call_orig = {0, SCREEN_HEIGHT - 8}; + static const fontSize_t logo_font = FONT_SIZE_8PT; + static const fontSize_t call_font = FONT_SIZE_6PT; + #endif + + gfx_print(logo_orig, logo_font, TEXT_ALIGN_CENTER, yellow_fab413, "O P N\nR T X"); + gfx_print(call_orig, call_font, TEXT_ALIGN_CENTER, color_white, state.settings.callsign); vp_announceSplashScreen(); } diff --git a/openrtx/src/ui/default/ui_menu.c b/openrtx/src/ui/default/ui_menu.c index 10340b57..3069fd51 100644 --- a/openrtx/src/ui/default/ui_menu.c +++ b/openrtx/src/ui/default/ui_menu.c @@ -767,12 +767,23 @@ void _ui_drawMenuInfo(ui_state_t* ui_state) void _ui_drawMenuAbout() { gfx_clearScreen(); - point_t openrtx_pos = {layout.horizontal_pad, layout.line3_large_h}; + + point_t logo_pos; if(SCREEN_HEIGHT >= 100) - ui_drawSplashScreen(false); + { + logo_pos.x = 0; + logo_pos.y = SCREEN_HEIGHT / 5; + gfx_print(logo_pos, FONT_SIZE_12PT, TEXT_ALIGN_CENTER, yellow_fab413, + "O P N\nR T X"); + } else - gfx_print(openrtx_pos, layout.line3_large_font, TEXT_ALIGN_CENTER, - color_white, currentLanguage->openRTX); + { + logo_pos.x = layout.horizontal_pad; + logo_pos.y = layout.line3_large_h; + gfx_print(logo_pos, layout.line3_large_font, TEXT_ALIGN_CENTER, + yellow_fab413, currentLanguage->openRTX); + } + uint8_t line_h = layout.menu_h; point_t pos = {SCREEN_WIDTH / 7, SCREEN_HEIGHT - (line_h * (author_num - 1)) - 5}; for(int author = 0; author < author_num; author++) diff --git a/openrtx/src/ui/module17/ui.c b/openrtx/src/ui/module17/ui.c index 001f5b6a..8705610c 100644 --- a/openrtx/src/ui/module17/ui.c +++ b/openrtx/src/ui/module17/ui.c @@ -314,16 +314,12 @@ void ui_init() ui_state = (const struct ui_state_t){ 0 }; } -void ui_drawSplashScreen(bool centered) +void ui_drawSplashScreen() { gfx_clearScreen(); - point_t splash_origin = {0,0}; - if(centered) - splash_origin.y = SCREEN_HEIGHT / 2 - 6; - else - splash_origin.y = SCREEN_HEIGHT / 5; - gfx_print(splash_origin, FONT_SIZE_12PT, TEXT_ALIGN_CENTER, yellow_fab413, "O P N\nR T X"); + point_t origin = {0, (SCREEN_HEIGHT / 2) - 6}; + gfx_print(origin, FONT_SIZE_12PT, TEXT_ALIGN_CENTER, yellow_fab413, "O P N\nR T X"); } freq_t _ui_freq_add_digit(freq_t freq, uint8_t pos, uint8_t number) diff --git a/openrtx/src/ui/module17/ui_menu.c b/openrtx/src/ui/module17/ui_menu.c index fca8a648..cddd7fea 100644 --- a/openrtx/src/ui/module17/ui_menu.c +++ b/openrtx/src/ui/module17/ui_menu.c @@ -432,12 +432,11 @@ void _ui_drawMenuInfo(ui_state_t* ui_state) void _ui_drawMenuAbout() { gfx_clearScreen(); + point_t openrtx_pos = {layout.horizontal_pad, layout.line3_h}; - if(SCREEN_HEIGHT >= 100) - ui_drawSplashScreen(false); - else - gfx_print(openrtx_pos, layout.line3_font, TEXT_ALIGN_CENTER, - color_white, "OpenRTX"); + gfx_print(openrtx_pos, layout.line3_font, TEXT_ALIGN_CENTER, color_white, + "OpenRTX"); + uint8_t line_h = layout.menu_h; point_t pos = {SCREEN_WIDTH / 7, SCREEN_HEIGHT - (line_h * (author_num - 1)) - 5}; for(int author = 0; author < author_num; author++)