forked from len0rd/rockbox
fix FS#9144 hopefully for good... only update the screen if the time line is selected, or if talking menus are disabled, only update if the time line is actually on the screen. Also only update every 5s so scrolling lines still scroll. (turns out scroll_all was broken! fixed now)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17944 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2a75a9045c
commit
311d048f6f
4 changed files with 43 additions and 14 deletions
|
|
@ -249,9 +249,15 @@ void list_draw(struct screen *display, struct viewport *parent,
|
|||
list_text[display->screen_type].drawmode, item_offset);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (list->scroll_all)
|
||||
display->puts_scroll_style_offset(0, i-start, entry_name,
|
||||
list_text[display->screen_type].drawmode, item_offset);
|
||||
else
|
||||
display->puts_style_offset(0, i-start, entry_name,
|
||||
list_text[display->screen_type].drawmode, item_offset);
|
||||
}
|
||||
/* do the icon */
|
||||
if (list->callback_get_item_icon && global_settings.show_icons)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -786,6 +786,17 @@ bool list_do_action(int context, int timeout,
|
|||
return gui_synclist_do_button(lists, action, wrap);
|
||||
}
|
||||
|
||||
bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
|
||||
enum screen_type screen, int item)
|
||||
{
|
||||
struct viewport vp = *lists->parent[screen];
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
if (list_display_title(lists, lists->parent[screen]))
|
||||
vp.height -= list_title_height(lists, lists->parent[screen]);
|
||||
#endif
|
||||
return item <= (lists->start_item[screen] + viewport_get_nb_lines(&vp));
|
||||
}
|
||||
|
||||
/* Simple use list implementation */
|
||||
static int simplelist_line_count = 0;
|
||||
static char simplelist_text[SIMPLELIST_MAX_LINES][SIMPLELIST_MAX_LINELENGTH];
|
||||
|
|
|
|||
|
|
@ -171,6 +171,8 @@ extern void gui_synclist_set_title(struct gui_synclist * lists, char * title,
|
|||
int icon);
|
||||
extern void gui_synclist_hide_selection_marker(struct gui_synclist *lists,
|
||||
bool hide);
|
||||
extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
|
||||
enum screen_type screen, int item);
|
||||
/*
|
||||
* Do the action implied by the given button,
|
||||
* returns true if the action was handled.
|
||||
|
|
|
|||
|
|
@ -291,6 +291,7 @@ static int info_speak_item(int selected_item, void * data)
|
|||
|
||||
#if CONFIG_RTC
|
||||
struct tm *tm;
|
||||
static int last_talk = 0;
|
||||
#endif
|
||||
|
||||
switch (selected_item)
|
||||
|
|
@ -313,6 +314,8 @@ static int info_speak_item(int selected_item, void * data)
|
|||
}
|
||||
break;
|
||||
case INFO_DATE:
|
||||
if (TIME_AFTER(current_tick, last_talk + HZ*60))
|
||||
{
|
||||
tm = get_time();
|
||||
if (valid_time(tm))
|
||||
{
|
||||
|
|
@ -322,6 +325,8 @@ static int info_speak_item(int selected_item, void * data)
|
|||
{
|
||||
talk_id(LANG_UNKNOWN, true);
|
||||
}
|
||||
last_talk = current_tick;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case INFO_BUFFER: /* buffer */
|
||||
|
|
@ -417,15 +422,20 @@ static int info_action_callback(int action, struct gui_synclist *lists)
|
|||
return ACTION_REDRAW;
|
||||
}
|
||||
#if CONFIG_RTC
|
||||
else if (action == ACTION_NONE && lists->selected_item == INFO_TIME)
|
||||
else if (action == ACTION_NONE)
|
||||
{
|
||||
if ((global_settings.talk_menu && lists->selected_item == INFO_TIME) ||
|
||||
(!global_settings.talk_menu &&
|
||||
gui_synclist_item_is_onscreen(lists, 0, INFO_TIME)))
|
||||
{
|
||||
static int last_redraw = 0;
|
||||
if (TIME_AFTER(current_tick, last_redraw + HZ/2))
|
||||
if (TIME_AFTER(current_tick, last_redraw + HZ*5))
|
||||
{
|
||||
last_redraw = current_tick;
|
||||
return ACTION_REDRAW;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return action;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue