v2.2.1: Fix text overflowing input field borders and oversized detail-panel/stats text, restore correct native language names
This commit is contained in:
@@ -64,11 +64,11 @@ namespace {
|
|||||||
tft.setCursor(10, 10);
|
tft.setCursor(10, 10);
|
||||||
tft.println(I18n::t(StringId::AIRLINE_ADD_TITLE));
|
tft.println(I18n::t(StringId::AIRLINE_ADD_TITLE));
|
||||||
|
|
||||||
tft.fillRect(8, 40, Config::SCREEN_WIDTH - 16, 30, TFT_BLACK);
|
tft.fillRect(8, 40, Config::SCREEN_WIDTH - 16, 34, TFT_BLACK);
|
||||||
tft.drawRect(8, 40, Config::SCREEN_WIDTH - 16, 30, TFT_GREEN);
|
tft.drawRect(8, 40, Config::SCREEN_WIDTH - 16, 34, TFT_GREEN);
|
||||||
tft.setTextSize(2);
|
tft.setTextSize(2);
|
||||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
tft.setCursor(14, 47);
|
tft.setCursor(14, 66);
|
||||||
tft.print(buf);
|
tft.print(buf);
|
||||||
tft.setTextSize(1);
|
tft.setTextSize(1);
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,7 @@ void run(TFT_eSPI& tft) {
|
|||||||
tft.fillScreen(TFT_BLACK);
|
tft.fillScreen(TFT_BLACK);
|
||||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
tft.setTextDatum(MC_DATUM);
|
tft.setTextDatum(MC_DATUM);
|
||||||
tft.setTextSize(2);
|
|
||||||
tft.drawString("Language / Sprache", Config::SCREEN_WIDTH / 2, 24);
|
tft.drawString("Language / Sprache", Config::SCREEN_WIDTH / 2, 24);
|
||||||
tft.setTextSize(1);
|
|
||||||
tft.setTextDatum(TL_DATUM);
|
tft.setTextDatum(TL_DATUM);
|
||||||
|
|
||||||
Rect langRects[I18n::LANG_COUNT];
|
Rect langRects[I18n::LANG_COUNT];
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const char* const LANGUAGE_NAMES[LANG_COUNT] = {
|
const char* const LANGUAGE_NAMES[LANG_COUNT] = {
|
||||||
"English", "Deutsch", "Francais", "Turkce", "Espanol", "Italiano"
|
"English", "Deutsch", "Français", "Türkçe", "Español", "Italiano"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ namespace {
|
|||||||
tft.drawRect(8, 40, Config::SCREEN_WIDTH - 16, 34, TFT_GREEN);
|
tft.drawRect(8, 40, Config::SCREEN_WIDTH - 16, 34, TFT_GREEN);
|
||||||
tft.setTextSize(2);
|
tft.setTextSize(2);
|
||||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
tft.setCursor(14, 49);
|
tft.setCursor(14, 66);
|
||||||
tft.print(buf);
|
tft.print(buf);
|
||||||
tft.setTextSize(1);
|
tft.setTextSize(1);
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace {
|
|||||||
delay(1200);
|
delay(1200);
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class Page { Main, Region, Wifi, System, Flight };
|
enum class Page { Main, Region, System, Flight };
|
||||||
}
|
}
|
||||||
|
|
||||||
void run(TFT_eSPI& tft) {
|
void run(TFT_eSPI& tft) {
|
||||||
@@ -107,7 +107,7 @@ void run(TFT_eSPI& tft) {
|
|||||||
if (regionBtn.contains(tap.x, tap.y)) {
|
if (regionBtn.contains(tap.x, tap.y)) {
|
||||||
page = Page::Region;
|
page = Page::Region;
|
||||||
} else if (wifiBtn.contains(tap.x, tap.y)) {
|
} else if (wifiBtn.contains(tap.x, tap.y)) {
|
||||||
page = Page::Wifi;
|
WifiManageScreen::run(tft);
|
||||||
} else if (systemBtn.contains(tap.x, tap.y)) {
|
} else if (systemBtn.contains(tap.x, tap.y)) {
|
||||||
page = Page::System;
|
page = Page::System;
|
||||||
} else if (flightBtn.contains(tap.x, tap.y)) {
|
} else if (flightBtn.contains(tap.x, tap.y)) {
|
||||||
@@ -143,29 +143,6 @@ void run(TFT_eSPI& tft) {
|
|||||||
page = Page::Main;
|
page = Page::Main;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (page == Page::Wifi) {
|
|
||||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
|
||||||
tft.setCursor(10, 2);
|
|
||||||
tft.println(I18n::t(StringId::MENU_CATEGORY_WIFI));
|
|
||||||
|
|
||||||
Rect wifiManageBtn = rowRect(0);
|
|
||||||
Rect backBtn = rowRect(1);
|
|
||||||
|
|
||||||
drawButton(tft, wifiManageBtn, I18n::t(StringId::MENU_MANAGE_WIFI));
|
|
||||||
drawButton(tft, backBtn, I18n::t(StringId::BACK_ARROW));
|
|
||||||
|
|
||||||
TouchInput::Point tap;
|
|
||||||
while (true) {
|
|
||||||
if (TouchInput::wasTapped(tap)) break;
|
|
||||||
delay(20);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wifiManageBtn.contains(tap.x, tap.y)) {
|
|
||||||
WifiManageScreen::run(tft);
|
|
||||||
} else if (backBtn.contains(tap.x, tap.y)) {
|
|
||||||
page = Page::Main;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (page == Page::System) {
|
} else if (page == Page::System) {
|
||||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
tft.setCursor(10, 2);
|
tft.setCursor(10, 2);
|
||||||
|
|||||||
@@ -24,18 +24,28 @@ namespace {
|
|||||||
tft.setTextDatum(TL_DATUM);
|
tft.setTextDatum(TL_DATUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
void drawStatRow(TFT_eSPI& tft, int16_t y, const String& label, const String& value) {
|
// Label (gedaempftes Gruen) direkt ueber dem Wert (helles Gruen) - BEIDE
|
||||||
|
// in derselben Schriftgroesse (Size 1). Bewusst KEINE gemischten
|
||||||
|
// Groessen mehr in einer Zeile: das Zusammenspiel aus Grundlinien-
|
||||||
|
// Verankerung + Size-2-Skalierung unseres Fonts fuehrte trotz
|
||||||
|
// rechnerisch korrektem Abstand zu sichtbaren Ueberschneidungen. Mit
|
||||||
|
// einheitlicher Groesse ist der noetige Abstand simpel und zuverlaessig.
|
||||||
|
void drawStatRow(TFT_eSPI& tft, int16_t labelY, const String& label, const String& value) {
|
||||||
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
|
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
|
||||||
tft.setCursor(10, y);
|
tft.setCursor(10, labelY);
|
||||||
tft.print(label);
|
tft.print(label);
|
||||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
tft.setTextSize(2);
|
tft.setCursor(10, labelY + 20);
|
||||||
tft.setCursor(10, y + 14);
|
|
||||||
tft.print(value);
|
tft.print(value);
|
||||||
tft.setTextSize(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr uint32_t CONFIRM_WINDOW_MS = 4000;
|
constexpr uint32_t CONFIRM_WINDOW_MS = 4000;
|
||||||
|
|
||||||
|
constexpr int16_t ROW1_Y = 44;
|
||||||
|
constexpr int16_t ROW2_Y = 84;
|
||||||
|
constexpr int16_t ROW3_Y = 124;
|
||||||
|
constexpr int16_t ROW4_Y = 164;
|
||||||
|
constexpr int16_t UPTIME_Y = 202;
|
||||||
}
|
}
|
||||||
|
|
||||||
void run(TFT_eSPI& tft) {
|
void run(TFT_eSPI& tft) {
|
||||||
@@ -44,7 +54,7 @@ void run(TFT_eSPI& tft) {
|
|||||||
tft.setCursor(10, 10);
|
tft.setCursor(10, 10);
|
||||||
tft.println(I18n::t(StringId::STATS_TITLE));
|
tft.println(I18n::t(StringId::STATS_TITLE));
|
||||||
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
|
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
|
||||||
tft.setCursor(10, 44);
|
tft.setCursor(10, ROW1_Y);
|
||||||
tft.print(I18n::t(StringId::LOADING));
|
tft.print(I18n::t(StringId::LOADING));
|
||||||
|
|
||||||
uint16_t today = FlightLogbook::todayCount();
|
uint16_t today = FlightLogbook::todayCount();
|
||||||
@@ -65,19 +75,19 @@ void run(TFT_eSPI& tft) {
|
|||||||
tft.setCursor(10, 10);
|
tft.setCursor(10, 10);
|
||||||
tft.println(I18n::t(StringId::STATS_TITLE));
|
tft.println(I18n::t(StringId::STATS_TITLE));
|
||||||
|
|
||||||
drawStatRow(tft, 44, I18n::t(StringId::STATS_TODAY), String(today));
|
drawStatRow(tft, ROW1_Y, I18n::t(StringId::STATS_TODAY), String(today));
|
||||||
drawStatRow(tft, 90, I18n::t(StringId::STATS_ALLTIME), String(allTimeAircraft));
|
drawStatRow(tft, ROW2_Y, I18n::t(StringId::STATS_ALLTIME), String(allTimeAircraft));
|
||||||
drawStatRow(tft, 136, I18n::t(StringId::STATS_DAYS), String(allTimeDays));
|
drawStatRow(tft, ROW3_Y, I18n::t(StringId::STATS_DAYS), String(allTimeDays));
|
||||||
|
|
||||||
if (justReset) {
|
if (justReset) {
|
||||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
tft.setCursor(10, 182);
|
tft.setCursor(10, ROW4_Y);
|
||||||
tft.print(I18n::t(StringId::STATS_RESET_DONE));
|
tft.print(I18n::t(StringId::STATS_RESET_DONE));
|
||||||
} else if (allTimeDays > 0) {
|
} else if (allTimeDays > 0) {
|
||||||
float avgPerDay = (float)allTimeAircraft / (float)allTimeDays;
|
float avgPerDay = (float)allTimeAircraft / (float)allTimeDays;
|
||||||
char buf[16];
|
char buf[16];
|
||||||
snprintf(buf, sizeof(buf), "%.1f", avgPerDay);
|
snprintf(buf, sizeof(buf), "%.1f", avgPerDay);
|
||||||
drawStatRow(tft, 182, I18n::t(StringId::STATS_AVG), String(buf));
|
drawStatRow(tft, ROW4_Y, I18n::t(StringId::STATS_AVG), String(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t upSec = millis() / 1000;
|
uint32_t upSec = millis() / 1000;
|
||||||
@@ -86,7 +96,7 @@ void run(TFT_eSPI& tft) {
|
|||||||
char upBuf[8];
|
char upBuf[8];
|
||||||
snprintf(upBuf, sizeof(upBuf), "%luh %lum", (unsigned long)upH, (unsigned long)upM);
|
snprintf(upBuf, sizeof(upBuf), "%luh %lum", (unsigned long)upH, (unsigned long)upM);
|
||||||
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
|
tft.setTextColor(TFT_DARKGREEN, TFT_BLACK);
|
||||||
tft.setCursor(10, 210);
|
tft.setCursor(10, UPTIME_Y);
|
||||||
tft.print(String(I18n::t(StringId::STATS_UPTIME_PREFIX)) + upBuf);
|
tft.print(String(I18n::t(StringId::STATS_UPTIME_PREFIX)) + upBuf);
|
||||||
|
|
||||||
if (confirmPending) {
|
if (confirmPending) {
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ bool run(TFT_eSPI& tft) {
|
|||||||
tft.println(I18n::t(StringId::WIFI_PASSWORD_LABEL));
|
tft.println(I18n::t(StringId::WIFI_PASSWORD_LABEL));
|
||||||
tft.fillRect(8, 38, Config::SCREEN_WIDTH - 16, 22, TFT_BLACK);
|
tft.fillRect(8, 38, Config::SCREEN_WIDTH - 16, 22, TFT_BLACK);
|
||||||
tft.drawRect(8, 38, Config::SCREEN_WIDTH - 16, 22, TFT_GREEN);
|
tft.drawRect(8, 38, Config::SCREEN_WIDTH - 16, 22, TFT_GREEN);
|
||||||
tft.setCursor(12, 44);
|
tft.setCursor(12, 56);
|
||||||
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
tft.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||||
tft.print(passwordBuf);
|
tft.print(passwordBuf);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user