Skip to content

Commit

Permalink
Minor changes on the battery icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Quest84 committed Jul 30, 2021
1 parent b384781 commit 810dced
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions source/status_bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,12 @@ static void StatusBar_GetBatteryStatus(int x, int y) {

snprintf(buf, 5, "%d%%", percent);
TTF_SizeText(ROBOTO_20, buf, &width, NULL);
SDL_DrawHorizonalAlignedImageText(RENDERER, batteryImage, ROBOTO_20, WHITE, buf, (x + width + 5), y, 34, 34, -2, -7);
SDL_DrawHorizonalAlignedImageText(RENDERER, batteryImage, ROBOTO_20, WHITE, buf, (x + width - 30), y, 34, 34, -2, 0);
//SDL_DrawText(RENDERER, ROBOTO_20, (x + width + 5), y, WHITE, buf);
} else {
snprintf(buf, 5, "%d%%", percent);
TTF_SizeText(ROBOTO_20, buf, &width, NULL);
SDL_DrawHorizonalAlignedImageText(RENDERER, battery_unknown, ROBOTO_20, WHITE, buf, x, y, 34, 34, -2, -7);

SDL_DrawHorizonalAlignedImageText(RENDERER, battery_unknown, ROBOTO_20, WHITE, buf, x, y, 34, 34, -2, 0);
/*SDL_DrawText(RENDERER, ROBOTO_20, (x + width + 5), y, WHITE, buf);
SDL_DrawImage(RENDERER, battery_unknown, x, 1);*/
}
Expand All @@ -126,19 +125,16 @@ void StatusBar_DisplayTime(bool portriat) {

if (portriat) {
int timeX = (1280 - timeWidth) + timeHeight;
int timeY = (720 - timeWidth) + 15;
SDL_DrawRotatedText(RENDERER, ROBOTO_25, (double) 90, timeX, timeY, WHITE, Clock_GetCurrentTime());
int timeY = (720 - timeWidth) + 15;
SDL_DrawRotatedText(RENDERER, ROBOTO_25, (double) 90, timeX, timeY, WHITE, Clock_GetCurrentTime());

int helpX = (1280 - helpWidth) + 21;
int helpY = (720 - helpHeight) - (720 - timeY) - 75;
SDL_DrawRotatedText(RENDERER, ROBOTO_20, (double) 90, helpX, helpY, WHITE, "\"+\" - Help");

//SDL_DrawRotatedText(RENDERER, ROBOTO_25, (double) 90, 1270 - width, (720 - height), WHITE, Clock_GetCurrentTime());
} else {
SDL_DrawText(RENDERER, ROBOTO_25, 1260 - timeWidth, (40 - timeHeight) / 2, WHITE, Clock_GetCurrentTime());

SDL_DrawText(RENDERER, ROBOTO_20, 1260 - helpWidth - timeWidth - 25, (40 - helpHeight) / 2, WHITE, "\"+\" - Help");

StatusBar_GetBatteryStatus(1260 - (timeWidth + helpWidth) - 110, (40 - timeHeight) / 2 + 34); // 34 is height of battery img
}
}

0 comments on commit 810dced

Please sign in to comment.