# HG changeset patch # User ideenmodellierer # Date 1590520366 -7200 # Node ID eea282e733e8d023bf59c712bbb2cd4fb5bdb324 # Parent 90d1f793dcf2b4f21a2b69c9a4617a6ddbf01d74 Small corrections layout Divelog page 1: Reading the code the information on the right side of the page should be aligned to the right border. That was not done because of e.g. a to small field of view for a certain string. Introduced a define to have all information aligned to the same position diff -r 90d1f793dcf2 -r eea282e733e8 Discovery/Src/show_logbook.c --- a/Discovery/Src/show_logbook.c Tue May 26 21:12:02 2020 +0200 +++ b/Discovery/Src/show_logbook.c Tue May 26 21:12:46 2020 +0200 @@ -39,6 +39,8 @@ #include #include // for abs() +#define LOG_BORDER_OFFSET (50u) /* text offset from left / right display to text start/end */ + /* Private variables ---------------------------------------------------------*/ static GFX_DrawCfgScreen tLOGscreen; @@ -415,9 +417,9 @@ { SWindowGimpStyle wintemp; SWindowGimpStyle winsmal; - wintemp.left = 50; + wintemp.left = LOG_BORDER_OFFSET; wintemp.right = 799 - wintemp.left; - wintemp.top = 50; + wintemp.top = LOG_BORDER_OFFSET; wintemp.bottom = 479 - 40; SLogbookHeader logbookHeader; @@ -465,8 +467,8 @@ //Print time uint8_t hour = logbookHeader.timeHour; uint8_t minute = logbookHeader.timeMinute; - snprintf(text,20,"%02i:%02i",hour,minute); - Gfx_write_label_var(hgfx, 600, 749,10, &FontT42,CLUT_GasSensor1,text); + snprintf(text,20,"\002%02i:%02i",hour,minute); + Gfx_write_label_var(hgfx, 600, wintemp.right,10, &FontT42,CLUT_GasSensor1,text); //Print Dive Mode (OC/CCR/...) switch(logbookHeader.diveMode) @@ -493,12 +495,15 @@ { case GF_MODE: snprintf(text,20,"\002GF%u/%u",logbookHeader.gfLow_or_Vpm_conservatism,logbookHeader.gfHigh); - break; + break; case VPM_MODE: snprintf(text,20,"\002VPM +%u",logbookHeader.gfLow_or_Vpm_conservatism); - break; + break; + default: + snprintf(text,20," "); /* no information to be displayed */ + break; } - Gfx_write_label_var(hgfx, 600, 729,60, &FontT42,CLUT_GasSensor1,text); + Gfx_write_label_var(hgfx, 500, wintemp.right,60, &FontT42,CLUT_GasSensor1,text); } //Write Dive Time @@ -643,8 +648,8 @@ } if(bottlePressureStart != 0) { - snprintf(text,40,"%i | %i\016\016 Bar\017",bottlePressureStart,bottlePressureEnd); - Gfx_write_label_var(hgfx,600,800,440, &FontT42,CLUT_GasSensor1,text); + snprintf(text,40,"\002%i | %i\016\016 Bar\017",bottlePressureStart,bottlePressureEnd); + Gfx_write_label_var(hgfx,450,wintemp.right,440, &FontT42,CLUT_GasSensor1,text); } #endif //--- print coordinate system & depth graph with gaschanges ---