ui-new: страница POWER опущена ниже точек страниц
This commit is contained in:
1 parent
759a1bf340
commit
9a89c11a1b
1 file changed
+4
-3
@@ -1013,10 +1013,11 @@ void HomeScreen::renderPowerPage(DisplayDriver& display) {
|
||||
if (pct > 100) pct = 100;
|
||||
|
||||
// Крупная иконка батареи, справа — заряд и напряжение.
|
||||
// Верхние 12 px занимает статус-бар (имя ноды и индикатор батареи), поэтому начинаем ниже.
|
||||
// Сверху 12 px занимает статус-бар, под ним (13..17) — точки страниц,
|
||||
// поэтому группа начинается с y=19, а не вплотную к индикатору.
|
||||
// Группу привязываем к центру экрана: на TFT 240x320 фиксированные края разъезжались.
|
||||
const int half = display.width() / 2;
|
||||
const int iconX = half - 60, iconY = 16, iconW = 44, iconH = 22;
|
||||
const int iconX = half - 60, iconY = 19, iconW = 44, iconH = 22;
|
||||
display.setColor(UIColor::primary_txt);
|
||||
display.drawRect(iconX, iconY, iconW, iconH);
|
||||
display.fillRect(iconX + iconW, iconY + 6, 3, iconH - 12); // "пипка"
|
||||
@@ -1032,7 +1033,7 @@ void HomeScreen::renderPowerPage(DisplayDriver& display) {
|
||||
display.setTextSize(1);
|
||||
if (mv > 0) snprintf(tmp, sizeof(tmp), "%.2f V", mv / 1000.0f);
|
||||
else strcpy(tmp, "-- V");
|
||||
display.drawTextRightAlign(half + 60, iconY + iconH + 4, tmp);
|
||||
display.drawTextRightAlign(half + 60, iconY + iconH + 1, tmp);
|
||||
|
||||
display.setColor(UIColor::primary_txt);
|
||||
display.drawTextCentered(display.width() / 2, 64 - 11, "power: " PRESS_LABEL);
|
||||
|
||||
Reference in new issue
Block a user