]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/gfxmenu/gui_list.c: Fix height calculation.
authorVladimir Testov <vladimir.testov@rosalab.ru>
Sun, 14 Jul 2013 21:02:37 +0000 (23:02 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 14 Jul 2013 21:02:37 +0000 (23:02 +0200)
ChangeLog
grub-core/gfxmenu/gui_list.c

index c68075c038974008231acc638e9167f7269d6329..8d8596fd16d64bb60fe10d5e27cfd20136db3cde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-14  Vladimir Testov <vladimir.testov@rosalab.ru>
+
+       * grub-core/gfxmenu/gui_list.c: Fix height calculation.
+
 2013-07-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/zfs/zfs.c: Stylistic fixes.
index 12c352863ce58dca1dcc78ef2b967ae8e204ea2d..d4e9817c5c0d2e82045b0624bdc73a556fd68b50 100644 (file)
@@ -102,9 +102,13 @@ get_num_shown_items (list_impl_t self)
   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);
+          - sel_top_pad - sel_bottom_pad
+          - box_top_pad - box_bottom_pad) / (item_height + item_vspace);
 }
 
 static int
@@ -257,7 +261,7 @@ draw_menu (list_impl_t self, int num_shown_items)
          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->set_content_size (selbox, cwidth, item_height);
           selbox->draw (selbox, 0,
                         item_top - sel_toppad);
         }
@@ -397,7 +401,8 @@ list_get_minimal_size (void *vself, unsigned *width, unsigned *height)
       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,
@@ -411,7 +416,8 @@ list_get_minimal_size (void *vself, unsigned *width, unsigned *height)
       *height = (item_height * num_items
                  + item_vspace * (num_items - 1)
                  + 2 * boxpad
-                 + box_top_pad + box_bottom_pad + sel_toppad);
+                 + box_top_pad + box_bottom_pad
+                 + sel_top_pad + sel_bottom_pad);
     }
   else
     {