Small ui tweaks

This commit is contained in:
2024-11-21 23:32:55 -05:00
parent 1cb5f8bc89
commit 28e9124c09
2 changed files with 21 additions and 17 deletions

View File

@@ -33,6 +33,10 @@ void Handler(int sigNum) {
exit(0);
}
int computeWidth(char* text, sFONT *font) {
return (font->Width) * strlen(text);
}
void code(UWORD *blackImage, char* confName) {
int ch;
codeLoop:
@@ -52,7 +56,7 @@ void code(UWORD *blackImage, char* confName) {
const char *code = getCode(confStr);
DebugLine(3, 0, "Code: %s\n", code);
Paint_DrawString(5, 20, code, &Font36, WHITE, BLACK);
Paint_DrawString(5, 5, confName, &Font12, WHITE, BLACK);
Paint_DrawString(8, 5, confName, &Font12, WHITE, BLACK);
Paint_DrawRectangle(10, 114, 240, 94, BLACK, DOT_PIXEL_1X1, DRAW_FILL_EMPTY);
EPD_2in13_V4_Display_Base(blackImage);
@@ -77,11 +81,11 @@ void code(UWORD *blackImage, char* confName) {
DebugLine(4, 0, "Time Left: %d\n", i);
double percentLeft = (double) i / (double) (30 * 1000);
progBarEndIndex = 228 - (int) (228 * percentLeft);
Paint_ClearWindows(progBarCurrentIndex, 113, progBarEndIndex, 93, WHITE);
Paint_ClearWindows(progBarCurrentIndex, 113, progBarEndIndex, 95, WHITE);
int line = 15;
while (progBarCurrentIndex < progBarEndIndex) {
DebugLine(line, 0, "Line: %d,113 - %d,93\n", progBarCurrentIndex, progBarEndIndex);
Paint_DrawLine(progBarCurrentIndex, 113, progBarCurrentIndex, 93, BLACK, DOT_PIXEL_1X1,
DebugLine(line, 0, "Line: %d,113 - %d,95\n", progBarCurrentIndex, progBarEndIndex);
Paint_DrawLine(progBarCurrentIndex, 113, progBarCurrentIndex, 95, BLACK, DOT_PIXEL_1X1,
LINE_STYLE_SOLID);
++progBarCurrentIndex;
++line;