You've already forked TEF6686_ESP32
Fix battery bar indicator, added rounded edges
This commit is contained in:
@@ -2846,18 +2846,18 @@ void ShowBattery() {
|
|||||||
if (batteryold != battery) {
|
if (batteryold != battery) {
|
||||||
if (batterydetect) {
|
if (batterydetect) {
|
||||||
if (battery == 0) {
|
if (battery == 0) {
|
||||||
tft.drawRect(277, 6, 37, 20, BarSignificantColor);
|
tft.drawRoundRect(277, 6, 37, 20, 2, BarSignificantColor);
|
||||||
tft.fillRect(313, 13, 4, 6, BarSignificantColor);
|
tft.fillRoundRect(313, 13, 4, 6, 2, BarSignificantColor);
|
||||||
} else {
|
} else {
|
||||||
tft.drawRect(277, 6, 37, 20, ActiveColor);
|
tft.drawRoundRect(277, 6, 37, 20, 2, ActiveColor);
|
||||||
tft.fillRect(313, 13, 4, 6, ActiveColor);
|
tft.fillRoundRect(313, 13, 4, 6, 2, ActiveColor);
|
||||||
}
|
}
|
||||||
tft.fillRect(279, 8, 33, 16, BackgroundColor);
|
tft.fillRoundRect(279, 8, 33, 16, 2, BackgroundColor);
|
||||||
if (batteryoptions != BATTERY_VALUE && batteryoptions != BATTERY_PERCENT) tft.fillRect(279, 8, 17 + (battery * 4), 16, BarInsignificantColor);
|
if (batteryoptions != BATTERY_VALUE && batteryoptions != BATTERY_PERCENT) tft.fillRoundRect(279, 8, (battery * 8) , 16, 2, BarInsignificantColor);
|
||||||
} else {
|
} else {
|
||||||
tft.drawRect(277, 6, 37, 20, GreyoutColor);
|
tft.drawRoundRect(277, 6, 37, 20, 2, GreyoutColor);
|
||||||
tft.fillRect(313, 13, 4, 6, GreyoutColor);
|
tft.fillRoundRect(313, 13, 4, 6, 2, GreyoutColor);
|
||||||
tft.fillRect(279, 8, 33, 16, BackgroundColor);
|
tft.fillRoundRect(279, 8, 33, 16, 2, BackgroundColor);
|
||||||
}
|
}
|
||||||
batteryold = battery;
|
batteryold = battery;
|
||||||
batteryVold = 0;
|
batteryVold = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user