mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 06:32:06 +00:00
Battery Circumcision
This commit is contained in:
parent
afc710a868
commit
c49f20f96c
@ -1024,7 +1024,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y)
|
|||||||
|
|
||||||
// === Battery dynamically scaled ===
|
// === Battery dynamically scaled ===
|
||||||
const int nubSize = 2;
|
const int nubSize = 2;
|
||||||
const int batteryLong = screenWidth > 200 ? 28 : 24; // Wider on bigger TFTs
|
const int batteryLong = screenWidth > 200 ? 29 : 25; // Was 28/24
|
||||||
const int batteryShort = highlightHeight - nubSize - 2;
|
const int batteryShort = highlightHeight - nubSize - 2;
|
||||||
|
|
||||||
int batteryX = x + xOffset;
|
int batteryX = x + xOffset;
|
||||||
@ -1050,7 +1050,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y)
|
|||||||
display->fillRect(
|
display->fillRect(
|
||||||
batteryX + batteryLong,
|
batteryX + batteryLong,
|
||||||
batteryY + (batteryShort / 2) - 3,
|
batteryY + (batteryShort / 2) - 3,
|
||||||
nubSize + 2, 6
|
nubSize + 1, 6
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isCharging && isBoltVisible) {
|
if (isCharging && isBoltVisible) {
|
||||||
@ -1077,12 +1077,12 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y)
|
|||||||
} else {
|
} else {
|
||||||
// === Vertical battery ===
|
// === Vertical battery ===
|
||||||
const int batteryWidth = 8;
|
const int batteryWidth = 8;
|
||||||
const int batteryHeight = batteryShort;
|
const int batteryHeight = batteryShort + 1;
|
||||||
const int totalBatteryHeight = batteryHeight + nubSize;
|
const int totalBatteryHeight = batteryHeight + nubSize;
|
||||||
batteryX += -2;
|
batteryX += -2;
|
||||||
batteryY = y + (highlightHeight - totalBatteryHeight) / 2 + nubSize;
|
batteryY = y + (highlightHeight - totalBatteryHeight) / 2 + nubSize;
|
||||||
|
|
||||||
display->fillRect(batteryX + 2, batteryY - nubSize, 4, nubSize); // Nub
|
display->fillRect(batteryX + 2, batteryY - (nubSize - 1), 4, nubSize - 1); // Nub
|
||||||
display->drawRect(batteryX, batteryY, batteryWidth, batteryHeight); // Body
|
display->drawRect(batteryX, batteryY, batteryWidth, batteryHeight); // Body
|
||||||
|
|
||||||
if (isCharging && isBoltVisible) {
|
if (isCharging && isBoltVisible) {
|
||||||
|
Loading…
Reference in New Issue
Block a user