diff --git a/firmware/application/ui/ui_freqlist.cpp b/firmware/application/ui/ui_freqlist.cpp index b7acefc2a..47460a1b3 100644 --- a/firmware/application/ui/ui_freqlist.cpp +++ b/firmware/application/ui/ui_freqlist.cpp @@ -65,8 +65,13 @@ void FreqManUIList::paint(Painter& painter) { painter.fill_rectangle( r_widget_screen, Color::black()); + // only return after clearing the screen so previous entries are not shown anymore if (freqlist_db.size() == 0) return; + // coloration if file is too big + Style* text_color = &style_default; + if (freqlist_db.size() > FREQMAN_MAX_PER_FILE) + text_color = &style_yellow; uint8_t nb_lines = 0; for (uint8_t it = current_index; it < freqlist_db.size(); it++) { uint8_t line_height = (int)nb_lines * char_height; @@ -75,7 +80,7 @@ void FreqManUIList::paint(Painter& painter) { // line is within the widget painter.draw_string( {0, r.location().y() + (int)nb_lines * char_height}, - style_default, description); + *text_color, description); if (nb_lines == highlighted_index) { const Rect r_highlighted_freq{0, r.location().y() + (int)nb_lines * char_height, 240, char_height}; painter.draw_rectangle( diff --git a/firmware/application/ui/ui_freqlist.hpp b/firmware/application/ui/ui_freqlist.hpp index f186855d1..3c89d1e4c 100644 --- a/firmware/application/ui/ui_freqlist.hpp +++ b/firmware/application/ui/ui_freqlist.hpp @@ -61,12 +61,16 @@ class FreqManUIList : public Widget { void set_db(freqman_db& db); private: - static constexpr Style style_default{ + Style style_default{ .font = font::fixed_8x16, .background = Color::black(), .foreground = Color::white(), }; - + Style style_yellow{ + .font = font::fixed_8x16, + .background = Color::black(), + .foreground = Color::yellow(), + }; static constexpr int8_t char_height = 16; bool instant_exec_{false}; freqman_db freqlist_db{};