diff options
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r-- | apps/gui/list.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index adeff533b0..2fb531b6bd 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -212,6 +212,7 @@ static void gui_list_draw_smart(struct gui_list *gui_list) | |||
212 | bool draw_cursor; | 212 | bool draw_cursor; |
213 | int i; | 213 | int i; |
214 | int lines; | 214 | int lines; |
215 | static int last_lines[NB_SCREENS] = {0}; | ||
215 | #ifdef HAVE_LCD_BITMAP | 216 | #ifdef HAVE_LCD_BITMAP |
216 | int item_offset; | 217 | int item_offset; |
217 | int old_margin = display->getxmargin(); | 218 | int old_margin = display->getxmargin(); |
@@ -221,6 +222,7 @@ static void gui_list_draw_smart(struct gui_list *gui_list) | |||
221 | 222 | ||
222 | #ifdef HAVE_LCD_BITMAP | 223 | #ifdef HAVE_LCD_BITMAP |
223 | display->setfont(FONT_UI); | 224 | display->setfont(FONT_UI); |
225 | gui_textarea_update_nblines(display); | ||
224 | #endif | 226 | #endif |
225 | /* Speed up UI by drawing the changed contents only. */ | 227 | /* Speed up UI by drawing the changed contents only. */ |
226 | if (gui_list == last_list_displayed[gui_list->display->screen_type] | 228 | if (gui_list == last_list_displayed[gui_list->display->screen_type] |
@@ -230,10 +232,12 @@ static void gui_list_draw_smart(struct gui_list *gui_list) | |||
230 | partial_draw = true; | 232 | partial_draw = true; |
231 | } | 233 | } |
232 | 234 | ||
233 | if (SHOW_LIST_TITLE) | 235 | lines = display->nb_lines - SHOW_LIST_TITLE; |
234 | lines = display->nb_lines - 1; | 236 | if (last_lines[display->screen_type] != lines) |
235 | else | 237 | { |
236 | lines = display->nb_lines; | 238 | gui_list_select_at_offset(gui_list, 0); |
239 | last_lines[display->screen_type] = lines; | ||
240 | } | ||
237 | 241 | ||
238 | if (partial_draw) | 242 | if (partial_draw) |
239 | { | 243 | { |