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(); void ui_init();
/** /**
* This function writes the OpenRTX splash screen image into the framebuffer. * This function writes the OpenRTX splash screen image into the framebuffer
* * centered in the screen space.
* @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.
*/ */
void ui_drawSplashScreen(bool centered); void ui_drawSplashScreen();
/** /**
* This function updates the local copy of the radio state * 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 // Display splash screen, turn on backlight after a suitable time to
// hide random pixels during render process // hide random pixels during render process
ui_drawSplashScreen(true); ui_drawSplashScreen();
gfx_render(); gfx_render();
sleepFor(0u, 30u); sleepFor(0u, 30u);
display_setBacklightLevel(state.settings.brightness); display_setBacklightLevel(state.settings.brightness);

Wyświetl plik

@ -1238,17 +1238,24 @@ void ui_init()
ui_state = (const struct ui_state_t){ 0 }; ui_state = (const struct ui_state_t){ 0 };
} }
void ui_drawSplashScreen(bool centered) void ui_drawSplashScreen()
{ {
gfx_clearScreen(); gfx_clearScreen();
point_t splash_origin = {0,0};
if(centered) #if SCREEN_HEIGHT > 64
splash_origin.y = SCREEN_HEIGHT / 2 - 6; static const point_t logo_orig = {0, (SCREEN_HEIGHT / 2) - 6};
else static const point_t call_orig = {0, SCREEN_HEIGHT - 8};
splash_origin.y = SCREEN_HEIGHT / 5; static const fontSize_t logo_font = FONT_SIZE_12PT;
gfx_print(splash_origin, FONT_SIZE_12PT, TEXT_ALIGN_CENTER, yellow_fab413, static const fontSize_t call_font = FONT_SIZE_8PT;
"O P N\nR T X"); #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(); vp_announceSplashScreen();
} }

Wyświetl plik

@ -767,12 +767,23 @@ void _ui_drawMenuInfo(ui_state_t* ui_state)
void _ui_drawMenuAbout() void _ui_drawMenuAbout()
{ {
gfx_clearScreen(); gfx_clearScreen();
point_t openrtx_pos = {layout.horizontal_pad, layout.line3_large_h};
point_t logo_pos;
if(SCREEN_HEIGHT >= 100) 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 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; uint8_t line_h = layout.menu_h;
point_t pos = {SCREEN_WIDTH / 7, SCREEN_HEIGHT - (line_h * (author_num - 1)) - 5}; point_t pos = {SCREEN_WIDTH / 7, SCREEN_HEIGHT - (line_h * (author_num - 1)) - 5};
for(int author = 0; author < author_num; author++) 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 }; ui_state = (const struct ui_state_t){ 0 };
} }
void ui_drawSplashScreen(bool centered) void ui_drawSplashScreen()
{ {
gfx_clearScreen(); gfx_clearScreen();
point_t splash_origin = {0,0};
if(centered) point_t origin = {0, (SCREEN_HEIGHT / 2) - 6};
splash_origin.y = SCREEN_HEIGHT / 2 - 6; gfx_print(origin, FONT_SIZE_12PT, TEXT_ALIGN_CENTER, yellow_fab413, "O P N\nR T X");
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");
} }
freq_t _ui_freq_add_digit(freq_t freq, uint8_t pos, uint8_t number) 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() void _ui_drawMenuAbout()
{ {
gfx_clearScreen(); gfx_clearScreen();
point_t openrtx_pos = {layout.horizontal_pad, layout.line3_h}; point_t openrtx_pos = {layout.horizontal_pad, layout.line3_h};
if(SCREEN_HEIGHT >= 100) gfx_print(openrtx_pos, layout.line3_font, TEXT_ALIGN_CENTER, color_white,
ui_drawSplashScreen(false); "OpenRTX");
else
gfx_print(openrtx_pos, layout.line3_font, TEXT_ALIGN_CENTER,
color_white, "OpenRTX");
uint8_t line_h = layout.menu_h; uint8_t line_h = layout.menu_h;
point_t pos = {SCREEN_WIDTH / 7, SCREEN_HEIGHT - (line_h * (author_num - 1)) - 5}; point_t pos = {SCREEN_WIDTH / 7, SCREEN_HEIGHT - (line_h * (author_num - 1)) - 5};
for(int author = 0; author < author_num; author++) for(int author = 0; author < author_num; author++)