* grub-core/gfxmenu/widget-box.c (get_left_pad): Take corners into

account.
	(get_top_pad): Likewise.
	(get_right_pad): Likewise.
	(get_bottom_pad): Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-14 14:20:57 +01:00
parent 9f59e9fc36
commit ca1b552c02
2 changed files with 53 additions and 5 deletions

View File

@ -1,6 +1,14 @@
2011-12-14 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/gfxmenu/gui_list.c (draw_menu): Don't use set in if.
* grub-core/gfxmenu/widget-box.c (get_left_pad): Take corners into
account.
(get_top_pad): Likewise.
(get_right_pad): Likewise.
(get_bottom_pad): Likewise.
2011-12-14 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/gfxmenu/gui_list.c (draw_menu): Don't use assignment in if.
2011-12-14 Vladimir Serbinenko <phcoder@gmail.com>

View File

@ -188,25 +188,65 @@ get_border_width (grub_gfxmenu_box_t self)
static int
get_left_pad (grub_gfxmenu_box_t self)
{
return get_width (self->raw_pixmaps[BOX_PIXMAP_W]);
int v, c;
v = get_width (self->raw_pixmaps[BOX_PIXMAP_W]);
c = get_width (self->raw_pixmaps[BOX_PIXMAP_NW]);
if (c > v)
v = c;
c = get_width (self->raw_pixmaps[BOX_PIXMAP_SW]);
if (c > v)
v = c;
return v;
}
static int
get_top_pad (grub_gfxmenu_box_t self)
{
return get_height (self->raw_pixmaps[BOX_PIXMAP_N]);
int v, c;
v = get_height (self->raw_pixmaps[BOX_PIXMAP_N]);
c = get_height (self->raw_pixmaps[BOX_PIXMAP_NW]);
if (c > v)
v = c;
c = get_height (self->raw_pixmaps[BOX_PIXMAP_NE]);
if (c > v)
v = c;
return v;
}
static int
get_right_pad (grub_gfxmenu_box_t self)
{
return get_width (self->raw_pixmaps[BOX_PIXMAP_E]);
int v, c;
v = get_width (self->raw_pixmaps[BOX_PIXMAP_E]);
c = get_width (self->raw_pixmaps[BOX_PIXMAP_NE]);
if (c > v)
v = c;
c = get_width (self->raw_pixmaps[BOX_PIXMAP_SE]);
if (c > v)
v = c;
return v;
}
static int
get_bottom_pad (grub_gfxmenu_box_t self)
{
return get_height (self->raw_pixmaps[BOX_PIXMAP_S]);
int v, c;
v = get_height (self->raw_pixmaps[BOX_PIXMAP_S]);
c = get_height (self->raw_pixmaps[BOX_PIXMAP_SW]);
if (c > v)
v = c;
c = get_height (self->raw_pixmaps[BOX_PIXMAP_SE]);
if (c > v)
v = c;
return v;
}
static void