Minor changes on the battery icon

This commit is contained in:
Question 2021-07-29 22:50:54 -05:00
parent b3847817f4
commit 810dced314
1 changed files with 4 additions and 8 deletions

View File

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