Weather display beautification (#1635)

This commit is contained in:
Mark Thompson 2023-12-10 10:57:21 -06:00 committed by GitHub
parent bd475e6f9c
commit c3bb9c0a16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 10 deletions

View File

@ -211,7 +211,7 @@ void RecentEntriesTable<ui::WeatherRecentEntries>::draw(
line += WeatherView::pad_string_with_spaces(6 - temp.length()) + temp; line += WeatherView::pad_string_with_spaces(6 - temp.length()) + temp;
line += WeatherView::pad_string_with_spaces(5 - humStr.length()) + humStr; line += WeatherView::pad_string_with_spaces(5 - humStr.length()) + humStr;
line += WeatherView::pad_string_with_spaces(4 - chStr.length()) + chStr; line += WeatherView::pad_string_with_spaces(4 - chStr.length()) + chStr;
line += WeatherView::pad_string_with_spaces(4 - ageStr.length()) + ageStr; line += WeatherView::pad_string_with_spaces(5 - ageStr.length()) + ageStr;
line.resize(target_rect.width() / 8, ' '); line.resize(target_rect.width() / 8, ' ');
painter.draw_string(target_rect.location(), style, line); painter.draw_string(target_rect.location(), style, line);

View File

@ -143,7 +143,7 @@ class WeatherView : public View {
{"Temp", 5}, {"Temp", 5},
{"Hum", 4}, {"Hum", 4},
{"Ch", 3}, {"Ch", 3},
{"Age", 3}, {"Age", 4},
}}; }};
WeatherRecentEntriesView recent_entries_view{columns, recent}; WeatherRecentEntriesView recent_entries_view{columns, recent};
@ -165,16 +165,17 @@ class WeatherRecentEntryDetailView : public View {
private: private:
NavigationView& nav_; NavigationView& nav_;
WeatherRecentEntry entry_{}; WeatherRecentEntry entry_{};
Text text_type{{0 * 8, 1 * 16, 15 * 8, 16}, "?"}; Text text_type{{10 * 8, 1 * 16, 15 * 8, 16}, "?"};
Text text_id{{6 * 8, 2 * 16, 10 * 8, 16}, "?"}; Text text_id{{10 * 8, 2 * 16, 10 * 8, 16}, "?"};
Text text_temp{{6 * 8, 3 * 16, 8 * 8, 16}, "?"}; Text text_temp{{10 * 8, 3 * 16, 8 * 8, 16}, "?"};
Text text_hum{{11 * 8, 4 * 16, 6 * 8, 16}, "?"}; Text text_hum{{10 * 8, 4 * 16, 6 * 8, 16}, "?"};
Text text_ch{{11 * 8, 5 * 16, 6 * 8, 16}, "?"}; Text text_ch{{10 * 8, 5 * 16, 6 * 8, 16}, "?"};
Text text_batt{{11 * 8, 6 * 16, 6 * 8, 16}, "?"}; Text text_batt{{10 * 8, 6 * 16, 6 * 8, 16}, "?"};
Text text_age{{11 * 8, 7 * 16, 6 * 8, 16}, "?"}; Text text_age{{10 * 8, 7 * 16, 10 * 8, 16}, "?"};
Labels labels{ Labels labels{
{{0 * 8, 0 * 16}, "Weather station type:", Color::light_grey()}, {{0 * 8, 0 * 16}, "Weather Station", Color::light_grey()},
{{0 * 8, 1 * 16}, "Type:", Color::light_grey()},
{{0 * 8, 2 * 16}, "Id: ", Color::light_grey()}, {{0 * 8, 2 * 16}, "Id: ", Color::light_grey()},
{{0 * 8, 3 * 16}, "Temp:", Color::light_grey()}, {{0 * 8, 3 * 16}, "Temp:", Color::light_grey()},
{{0 * 8, 4 * 16}, "Humidity:", Color::light_grey()}, {{0 * 8, 4 * 16}, "Humidity:", Color::light_grey()},