summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/bitmap/list.c10
-rw-r--r--apps/gui/list.c11
-rw-r--r--apps/gui/list.h2
-rw-r--r--apps/menus/main_menu.c34
4 files changed, 43 insertions, 14 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index 4aaecc7eab..5a8bc69450 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -250,8 +250,14 @@ void list_draw(struct screen *display, struct viewport *parent,
250 } 250 }
251 } 251 }
252 else 252 else
253 display->puts_style_offset(0, i-start, entry_name, 253 {
254 list_text[display->screen_type].drawmode, item_offset); 254 if (list->scroll_all)
255 display->puts_scroll_style_offset(0, i-start, entry_name,
256 list_text[display->screen_type].drawmode, item_offset);
257 else
258 display->puts_style_offset(0, i-start, entry_name,
259 list_text[display->screen_type].drawmode, item_offset);
260 }
255 /* do the icon */ 261 /* do the icon */
256 if (list->callback_get_item_icon && global_settings.show_icons) 262 if (list->callback_get_item_icon && global_settings.show_icons)
257 { 263 {
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 96652ce0a9..ee50ccf63e 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -786,6 +786,17 @@ bool list_do_action(int context, int timeout,
786 return gui_synclist_do_button(lists, action, wrap); 786 return gui_synclist_do_button(lists, action, wrap);
787} 787}
788 788
789bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
790 enum screen_type screen, int item)
791{
792 struct viewport vp = *lists->parent[screen];
793#ifdef HAVE_LCD_BITMAP
794 if (list_display_title(lists, lists->parent[screen]))
795 vp.height -= list_title_height(lists, lists->parent[screen]);
796#endif
797 return item <= (lists->start_item[screen] + viewport_get_nb_lines(&vp));
798}
799
789/* Simple use list implementation */ 800/* Simple use list implementation */
790static int simplelist_line_count = 0; 801static int simplelist_line_count = 0;
791static char simplelist_text[SIMPLELIST_MAX_LINES][SIMPLELIST_MAX_LINELENGTH]; 802static char simplelist_text[SIMPLELIST_MAX_LINES][SIMPLELIST_MAX_LINELENGTH];
diff --git a/apps/gui/list.h b/apps/gui/list.h
index e2d7a518e4..8db9c24d48 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -171,6 +171,8 @@ extern void gui_synclist_set_title(struct gui_synclist * lists, char * title,
171 int icon); 171 int icon);
172extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists, 172extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists,
173 bool hide); 173 bool hide);
174extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
175 enum screen_type screen, int item);
174/* 176/*
175 * Do the action implied by the given button, 177 * Do the action implied by the given button,
176 * returns true if the action was handled. 178 * returns true if the action was handled.
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index 985efc2580..614f5a6c34 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -291,6 +291,7 @@ static int info_speak_item(int selected_item, void * data)
291 291
292#if CONFIG_RTC 292#if CONFIG_RTC
293 struct tm *tm; 293 struct tm *tm;
294 static int last_talk = 0;
294#endif 295#endif
295 296
296 switch (selected_item) 297 switch (selected_item)
@@ -313,14 +314,18 @@ static int info_speak_item(int selected_item, void * data)
313 } 314 }
314 break; 315 break;
315 case INFO_DATE: 316 case INFO_DATE:
316 tm = get_time(); 317 if (TIME_AFTER(current_tick, last_talk + HZ*60))
317 if (valid_time(tm))
318 {
319 talk_date(get_time(), true);
320 }
321 else
322 { 318 {
323 talk_id(LANG_UNKNOWN, true); 319 tm = get_time();
320 if (valid_time(tm))
321 {
322 talk_date(get_time(), true);
323 }
324 else
325 {
326 talk_id(LANG_UNKNOWN, true);
327 }
328 last_talk = current_tick;
324 } 329 }
325 break; 330 break;
326#endif 331#endif
@@ -417,13 +422,18 @@ static int info_action_callback(int action, struct gui_synclist *lists)
417 return ACTION_REDRAW; 422 return ACTION_REDRAW;
418 } 423 }
419#if CONFIG_RTC 424#if CONFIG_RTC
420 else if (action == ACTION_NONE && lists->selected_item == INFO_TIME) 425 else if (action == ACTION_NONE)
421 { 426 {
422 static int last_redraw = 0; 427 if ((global_settings.talk_menu && lists->selected_item == INFO_TIME) ||
423 if (TIME_AFTER(current_tick, last_redraw + HZ/2)) 428 (!global_settings.talk_menu &&
429 gui_synclist_item_is_onscreen(lists, 0, INFO_TIME)))
424 { 430 {
425 last_redraw = current_tick; 431 static int last_redraw = 0;
426 return ACTION_REDRAW; 432 if (TIME_AFTER(current_tick, last_redraw + HZ*5))
433 {
434 last_redraw = current_tick;
435 return ACTION_REDRAW;
436 }
427 } 437 }
428 } 438 }
429#endif 439#endif