Take into account the decorations the computing menu entry width.

* grub-core/gfxmenu/widget-box.c (get_border_width): New function.
	(grub_gfxmenu_create_box): Register get_border_width.
	* grub-core/gfxmenu/gui_list.c (draw_menu): Use get_border_width
	if available.
	* include/grub/gfxwidgets.h (grub_gfxmenu_box): New member
	get_border_width.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-04-19 00:44:53 +02:00
parent e74b3947af
commit abc474ef4b
4 changed files with 25 additions and 2 deletions

View file

@ -248,8 +248,10 @@ draw_menu (list_impl_t self, int num_shown_items)
if (is_selected)
{
selbox->set_content_size (selbox, oviewport.width - 2 * boxpad - 2,
item_height - 1);
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);
selbox->draw (selbox, 0,
item_top - sel_toppad);
}