diff --git a/src/airline_filter_screen.cpp b/src/airline_filter_screen.cpp index 59e9e77..a0bbd82 100644 --- a/src/airline_filter_screen.cpp +++ b/src/airline_filter_screen.cpp @@ -64,11 +64,11 @@ namespace { tft.setCursor(10, 10); tft.println(I18n::t(StringId::AIRLINE_ADD_TITLE)); - tft.fillRect(8, 40, Config::SCREEN_WIDTH - 16, 30, TFT_BLACK); - tft.drawRect(8, 40, Config::SCREEN_WIDTH - 16, 30, TFT_GREEN); + tft.fillRect(8, 40, Config::SCREEN_WIDTH - 16, 34, TFT_BLACK); + tft.drawRect(8, 40, Config::SCREEN_WIDTH - 16, 34, TFT_GREEN); tft.setTextSize(2); tft.setTextColor(TFT_GREEN, TFT_BLACK); - tft.setCursor(14, 47); + tft.setCursor(14, 66); tft.print(buf); tft.setTextSize(1); diff --git a/src/first_run_language_screen.cpp b/src/first_run_language_screen.cpp index 2f2a1cb..daad2a3 100644 --- a/src/first_run_language_screen.cpp +++ b/src/first_run_language_screen.cpp @@ -36,9 +36,7 @@ void run(TFT_eSPI& tft) { tft.fillScreen(TFT_BLACK); tft.setTextColor(TFT_GREEN, TFT_BLACK); tft.setTextDatum(MC_DATUM); - tft.setTextSize(2); tft.drawString("Language / Sprache", Config::SCREEN_WIDTH / 2, 24); - tft.setTextSize(1); tft.setTextDatum(TL_DATUM); Rect langRects[I18n::LANG_COUNT]; diff --git a/src/i18n.cpp b/src/i18n.cpp index fc41869..4104427 100644 --- a/src/i18n.cpp +++ b/src/i18n.cpp @@ -15,7 +15,7 @@ namespace { }; const char* const LANGUAGE_NAMES[LANG_COUNT] = { - "English", "Deutsch", "Francais", "Turkce", "Espanol", "Italiano" + "English", "Deutsch", "Français", "Türkçe", "Español", "Italiano" }; } diff --git a/src/location_presets_screen.cpp b/src/location_presets_screen.cpp index c99f7ed..5f2bfbb 100644 --- a/src/location_presets_screen.cpp +++ b/src/location_presets_screen.cpp @@ -65,7 +65,7 @@ namespace { tft.drawRect(8, 40, Config::SCREEN_WIDTH - 16, 34, TFT_GREEN); tft.setTextSize(2); tft.setTextColor(TFT_GREEN, TFT_BLACK); - tft.setCursor(14, 49); + tft.setCursor(14, 66); tft.print(buf); tft.setTextSize(1); diff --git a/src/menu_screen.cpp b/src/menu_screen.cpp index e593ec4..8204860 100644 --- a/src/menu_screen.cpp +++ b/src/menu_screen.cpp @@ -71,7 +71,7 @@ namespace { delay(1200); } - enum class Page { Main, Region, Wifi, System, Flight }; + enum class Page { Main, Region, System, Flight }; } void run(TFT_eSPI& tft) { @@ -107,7 +107,7 @@ void run(TFT_eSPI& tft) { if (regionBtn.contains(tap.x, tap.y)) { page = Page::Region; } else if (wifiBtn.contains(tap.x, tap.y)) { - page = Page::Wifi; + WifiManageScreen::run(tft); } else if (systemBtn.contains(tap.x, tap.y)) { page = Page::System; } else if (flightBtn.contains(tap.x, tap.y)) { @@ -143,29 +143,6 @@ void run(TFT_eSPI& tft) { 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) { tft.setTextColor(TFT_GREEN, TFT_BLACK); tft.setCursor(10, 2); diff --git a/src/stats_screen.cpp b/src/stats_screen.cpp index 84f2f01..cba6052 100644 --- a/src/stats_screen.cpp +++ b/src/stats_screen.cpp @@ -24,18 +24,28 @@ namespace { 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.setCursor(10, y); + tft.setCursor(10, labelY); tft.print(label); tft.setTextColor(TFT_GREEN, TFT_BLACK); - tft.setTextSize(2); - tft.setCursor(10, y + 14); + tft.setCursor(10, labelY + 20); tft.print(value); - tft.setTextSize(1); } 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) { @@ -44,7 +54,7 @@ void run(TFT_eSPI& tft) { tft.setCursor(10, 10); tft.println(I18n::t(StringId::STATS_TITLE)); tft.setTextColor(TFT_DARKGREEN, TFT_BLACK); - tft.setCursor(10, 44); + tft.setCursor(10, ROW1_Y); tft.print(I18n::t(StringId::LOADING)); uint16_t today = FlightLogbook::todayCount(); @@ -65,19 +75,19 @@ void run(TFT_eSPI& tft) { tft.setCursor(10, 10); tft.println(I18n::t(StringId::STATS_TITLE)); - drawStatRow(tft, 44, I18n::t(StringId::STATS_TODAY), String(today)); - drawStatRow(tft, 90, I18n::t(StringId::STATS_ALLTIME), String(allTimeAircraft)); - drawStatRow(tft, 136, I18n::t(StringId::STATS_DAYS), String(allTimeDays)); + drawStatRow(tft, ROW1_Y, I18n::t(StringId::STATS_TODAY), String(today)); + drawStatRow(tft, ROW2_Y, I18n::t(StringId::STATS_ALLTIME), String(allTimeAircraft)); + drawStatRow(tft, ROW3_Y, I18n::t(StringId::STATS_DAYS), String(allTimeDays)); if (justReset) { tft.setTextColor(TFT_GREEN, TFT_BLACK); - tft.setCursor(10, 182); + tft.setCursor(10, ROW4_Y); tft.print(I18n::t(StringId::STATS_RESET_DONE)); } else if (allTimeDays > 0) { float avgPerDay = (float)allTimeAircraft / (float)allTimeDays; char buf[16]; 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; @@ -86,7 +96,7 @@ void run(TFT_eSPI& tft) { char upBuf[8]; snprintf(upBuf, sizeof(upBuf), "%luh %lum", (unsigned long)upH, (unsigned long)upM); 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); if (confirmPending) { diff --git a/src/wifi_setup_screen.cpp b/src/wifi_setup_screen.cpp index d7b74e4..3d547d6 100644 --- a/src/wifi_setup_screen.cpp +++ b/src/wifi_setup_screen.cpp @@ -362,7 +362,7 @@ bool run(TFT_eSPI& tft) { tft.println(I18n::t(StringId::WIFI_PASSWORD_LABEL)); tft.fillRect(8, 38, Config::SCREEN_WIDTH - 16, 22, TFT_BLACK); 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.print(passwordBuf);