Display callsign on splash screen

pull/195/head
Morgan Diepart 2023-10-22 18:02:04 -07:00 zatwierdzone przez Silvano Seva
rodzic 1035c2b801
commit f43281e815
6 zmienionych plików z 41 dodań i 30 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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);

Wyświetl plik

@ -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();
}

Wyświetl plik

@ -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++)

Wyświetl plik

@ -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)

Wyświetl plik

@ -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++)