mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-29 09:07:17 -04:00
Declare escape strings for colored text (#1409)
* Color strings * Color strings * Color strings * Color strings * Color strings * Color strings & fix first group scrolling off screen * Color strings * Color strings * Clang * Clang * Clang attempt #3 * Update ui_painter.cpp * Update ui_widget.cpp * Clang test * Clang * Clang test * Update ui_about_simple.cpp * Update lge_app.cpp
This commit is contained in:
parent
9af1308e29
commit
cf25d85d51
9 changed files with 49 additions and 36 deletions
|
@ -40,24 +40,22 @@ void RecentEntriesTable<AircraftRecentEntries>::draw(
|
|||
const Rect& target_rect,
|
||||
Painter& painter,
|
||||
const Style& style) {
|
||||
char aged_color;
|
||||
Color target_color;
|
||||
auto entry_age = entry.age;
|
||||
std::string entry_string;
|
||||
|
||||
// Color decay for flights not being updated anymore
|
||||
if (entry_age < ADSB_CURRENT) {
|
||||
aged_color = 0x10;
|
||||
entry_string = "";
|
||||
target_color = Color::green();
|
||||
} else if (entry_age < ADSB_RECENT) {
|
||||
aged_color = 0x07;
|
||||
entry_string = STR_COLOR_LIGHT_GREY;
|
||||
target_color = Color::light_grey();
|
||||
} else {
|
||||
aged_color = 0x08;
|
||||
entry_string = STR_COLOR_DARK_GREY;
|
||||
target_color = Color::grey();
|
||||
}
|
||||
|
||||
std::string entry_string = "\x1B";
|
||||
entry_string += aged_color;
|
||||
entry_string +=
|
||||
(entry.callsign[0] != ' ' ? entry.callsign + " " : entry.icaoStr + " ") +
|
||||
to_string_dec_uint((unsigned int)(entry.pos.altitude / 100), 4) +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue