* grub-core/gfxmenu/gui_list.c: Refresh first_shown_entry value when

cached view is reused.
	* grub-core/gfxmenu/view.c: Call the refresh procedure for all
	open boot menus.
This commit is contained in:
Vladimir Testov 2013-04-29 13:40:11 +02:00 committed by Vladimir 'phcoder' Serbinenko
parent c53b4e67e4
commit dc5a311a1e
4 changed files with 43 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2013-04-29 Vladimir Testov <vladimir.testov@rosalab.ru>
* grub-core/gfxmenu/gui_list.c: Refresh first_shown_entry value when
cached view is reused.
* grub-core/gfxmenu/view.c: Call the refresh procedure for all
open boot menus.
2013-04-29 Vladimir Serbinenko <phcoder@gmail.com> 2013-04-29 Vladimir Serbinenko <phcoder@gmail.com>
Unify more code in grub-install_header. Unify more code in grub-install_header.

View file

@ -541,6 +541,16 @@ list_set_view_info (void *vself,
self->view = view; self->view = view;
} }
/* Refresh list variables */
static void
list_refresh_info (void *vself,
grub_gfxmenu_view_t view)
{
list_impl_t self = vself;
if (view->nested)
self->first_shown_index = 0;
}
static struct grub_gui_component_ops list_comp_ops = static struct grub_gui_component_ops list_comp_ops =
{ {
.destroy = list_destroy, .destroy = list_destroy,
@ -557,7 +567,8 @@ static struct grub_gui_component_ops list_comp_ops =
static struct grub_gui_list_ops list_ops = static struct grub_gui_list_ops list_ops =
{ {
.set_view_info = list_set_view_info .set_view_info = list_set_view_info,
.refresh_list = list_refresh_info
}; };
grub_gui_component_t grub_gui_component_t

View file

@ -236,6 +236,27 @@ update_menu_components (grub_gfxmenu_view_t view)
update_menu_visit, view); update_menu_visit, view);
} }
static void
refresh_menu_visit (grub_gui_component_t component,
void *userdata)
{
grub_gfxmenu_view_t view;
view = userdata;
if (component->ops->is_instance (component, "list"))
{
grub_gui_list_t list = (grub_gui_list_t) component;
list->ops->refresh_list (list, view);
}
}
/* Refresh list information (useful for submenus) */
static void
refresh_menu_components (grub_gfxmenu_view_t view)
{
grub_gui_iterate_recursively ((grub_gui_component_t) view->canvas,
refresh_menu_visit, view);
}
static void static void
draw_message (grub_gfxmenu_view_t view) draw_message (grub_gfxmenu_view_t view)
{ {
@ -294,6 +315,7 @@ grub_gfxmenu_view_draw (grub_gfxmenu_view_t view)
view->screen.x, view->screen.y, view->screen.x, view->screen.y,
view->screen.width, view->screen.height); view->screen.width, view->screen.height);
refresh_menu_components (view);
update_menu_components (view); update_menu_components (view);
grub_gfxmenu_view_redraw (view, &view->screen); grub_gfxmenu_view_redraw (view, &view->screen);

View file

@ -67,6 +67,8 @@ struct grub_gui_list_ops
{ {
void (*set_view_info) (void *self, void (*set_view_info) (void *self,
grub_gfxmenu_view_t view); grub_gfxmenu_view_t view);
void (*refresh_list) (void *self,
grub_gfxmenu_view_t view);
}; };
struct grub_gui_progress_ops struct grub_gui_progress_ops