diff -Naur grub-new/grub-core/gfxmenu/gui_list.c grub-new2/grub-core/gfxmenu/gui_list.c --- grub-new/grub-core/gfxmenu/gui_list.c 2013-03-25 17:24:09.283623915 +0400 +++ grub-new2/grub-core/gfxmenu/gui_list.c 2013-03-25 17:42:18.730948425 +0400 @@ -98,9 +98,21 @@ grub_gfxmenu_box_t box = self->menu_box; int box_top_pad = box->get_top_pad (box); int box_bottom_pad = box->get_bottom_pad (box); + grub_gfxmenu_box_t selbox = self->selected_item_box; + int sel_top_pad = selbox->get_top_pad (selbox); + int sel_bottom_pad = selbox->get_bottom_pad (selbox); - return (self->bounds.height + item_vspace - 2 * boxpad - - box_top_pad - box_bottom_pad) / (item_height + item_vspace); + if (self->list_version == 0) + { + return (self->bounds.height + item_vspace - 2 * boxpad + - box_top_pad - box_bottom_pad) / (item_height + item_vspace); + } + else + { + return (self->bounds.height + item_vspace - 2 * boxpad + - sel_top_pad - sel_bottom_pad + - box_top_pad - box_bottom_pad) / (item_height + item_vspace); + } } static int @@ -253,7 +265,10 @@ int cwidth = oviewport.width - 2 * boxpad - 2; if (selbox->get_border_width) cwidth -= selbox->get_border_width (selbox); - selbox->set_content_size (selbox, cwidth, item_height - 1); + if (self->list_version == 0) + selbox->set_content_size (selbox, cwidth, item_height - 1); + else + selbox->set_content_size (selbox, cwidth, item_height); selbox->draw (selbox, 0, item_top - sel_toppad); } @@ -393,7 +408,8 @@ unsigned width_s; grub_gfxmenu_box_t selbox = self->selected_item_box; - int sel_toppad = selbox->get_top_pad (selbox); + int sel_top_pad = selbox->get_top_pad (selbox); + int sel_bottom_pad = selbox->get_bottom_pad (selbox); *width = grub_font_get_string_width (self->item_font, "Typical OS"); width_s = grub_font_get_string_width (self->selected_item_font, @@ -404,10 +420,21 @@ *width += 2 * boxpad + box_left_pad + box_right_pad; /* Set the menu box height to fit the items. */ - *height = (item_height * num_items - + item_vspace * (num_items - 1) - + 2 * boxpad - + box_top_pad + box_bottom_pad + sel_toppad); + if (self->list_version == 0) + { + *height = (item_height * num_items + + item_vspace * (num_items - 1) + + 2 * boxpad + + box_top_pad + box_bottom_pad + sel_top_pad); + } + else + { + *height = (item_height * num_items + + item_vspace * (num_items - 1) + + 2 * boxpad + + box_top_pad + box_bottom_pad + + sel_top_pad + sel_bottom_pad); + } } else {