* grub-core/gfxmenu/gui_list.c: Baseline misplacement fixed.
This commit is contained in:
parent
224a55bb07
commit
03dafa17df
2 changed files with 17 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2013-08-15 Vladimir Testov <vladimir.testov@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/gfxmenu/gui_list.c: Baseline misplacement fixed.
|
||||||
|
|
||||||
2013-08-15 Vladimir Testov <vladimir.testov@gmail.com>
|
2013-08-15 Vladimir Testov <vladimir.testov@gmail.com>
|
||||||
|
|
||||||
* grub-core/gfxmenu/gui_list.c: The number of color mappings is
|
* grub-core/gfxmenu/gui_list.c: The number of color mappings is
|
||||||
|
|
|
@ -231,6 +231,8 @@ draw_menu (list_impl_t self, int num_shown_items)
|
||||||
|
|
||||||
int ascent = grub_font_get_ascent (self->item_font);
|
int ascent = grub_font_get_ascent (self->item_font);
|
||||||
int descent = grub_font_get_descent (self->item_font);
|
int descent = grub_font_get_descent (self->item_font);
|
||||||
|
int selected_ascent = grub_font_get_ascent (self->selected_item_font);
|
||||||
|
int selected_descent = grub_font_get_descent (self->selected_item_font);
|
||||||
int item_height = self->item_height;
|
int item_height = self->item_height;
|
||||||
|
|
||||||
make_selected_item_visible (self);
|
make_selected_item_visible (self);
|
||||||
|
@ -255,12 +257,15 @@ draw_menu (list_impl_t self, int num_shown_items)
|
||||||
cwidth -= selbox->get_border_width (selbox);
|
cwidth -= selbox->get_border_width (selbox);
|
||||||
selbox->set_content_size (selbox, cwidth, item_height);
|
selbox->set_content_size (selbox, cwidth, item_height);
|
||||||
|
|
||||||
int string_left_offset = self->icon_width + icon_text_space;
|
int item_left_offset = self->icon_width + icon_text_space;
|
||||||
int string_top_offset = (item_height - (ascent + descent)) / 2 + ascent;
|
int item_top_offset = (item_height - (ascent + descent)) / 2 + ascent;
|
||||||
|
int selected_item_top_offset = (item_height - (selected_ascent
|
||||||
|
+ selected_descent)) / 2
|
||||||
|
+ selected_ascent;
|
||||||
|
|
||||||
grub_video_rect_t svpsave, sviewport;
|
grub_video_rect_t svpsave, sviewport;
|
||||||
sviewport.x = sel_leftpad + string_left_offset;
|
sviewport.x = sel_leftpad + item_left_offset;
|
||||||
sviewport.width = cwidth - string_left_offset;
|
sviewport.width = cwidth - item_left_offset;
|
||||||
sviewport.height = item_height;
|
sviewport.height = item_height;
|
||||||
|
|
||||||
grub_video_color_t item_color;
|
grub_video_color_t item_color;
|
||||||
|
@ -276,6 +281,7 @@ draw_menu (list_impl_t self, int num_shown_items)
|
||||||
struct grub_video_bitmap *icon;
|
struct grub_video_bitmap *icon;
|
||||||
grub_font_t font;
|
grub_font_t font;
|
||||||
grub_video_color_t color;
|
grub_video_color_t color;
|
||||||
|
int top_offset;
|
||||||
|
|
||||||
if (is_selected)
|
if (is_selected)
|
||||||
{
|
{
|
||||||
|
@ -283,11 +289,13 @@ draw_menu (list_impl_t self, int num_shown_items)
|
||||||
item_top - sel_toppad);
|
item_top - sel_toppad);
|
||||||
font = self->selected_item_font;
|
font = self->selected_item_font;
|
||||||
color = selected_item_color;
|
color = selected_item_color;
|
||||||
|
top_offset = selected_item_top_offset;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
font = self->item_font;
|
font = self->item_font;
|
||||||
color = item_color;
|
color = item_color;
|
||||||
|
top_offset = item_top_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
icon = get_item_icon (self, menu_index);
|
icon = get_item_icon (self, menu_index);
|
||||||
|
@ -306,7 +314,7 @@ draw_menu (list_impl_t self, int num_shown_items)
|
||||||
font,
|
font,
|
||||||
color,
|
color,
|
||||||
0,
|
0,
|
||||||
string_top_offset);
|
top_offset);
|
||||||
grub_gui_restore_viewport (&svpsave);
|
grub_gui_restore_viewport (&svpsave);
|
||||||
|
|
||||||
item_top += item_height + item_vspace;
|
item_top += item_height + item_vspace;
|
||||||
|
|
Loading…
Reference in a new issue