From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1U32rt-00038v-M6 for mharc-grub-devel@gnu.org; Wed, 06 Feb 2013 06:08:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U32rq-00037q-Li for grub-devel@gnu.org; Wed, 06 Feb 2013 06:08:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U32rp-0005ws-1Y for grub-devel@gnu.org; Wed, 06 Feb 2013 06:08:42 -0500 Received: from collab.rosalab.ru ([217.199.216.181]:40933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U32ro-0005wX-Lz for grub-devel@gnu.org; Wed, 06 Feb 2013 06:08:40 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by collab.rosalab.ru (Postfix) with ESMTP id C237029C37A for ; Wed, 6 Feb 2013 15:08:38 +0400 (MSK) X-Virus-Scanned: amavisd-new at rosalab.ru Received: from collab.rosalab.ru ([127.0.0.1]) by localhost (collab.rosalab.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G6aJTmaMrHgd for ; Wed, 6 Feb 2013 15:08:38 +0400 (MSK) Received: from icedphoenix.localnet (unknown [10.168.1.56]) by collab.rosalab.ru (Postfix) with ESMTPSA id 4CFC729C25F for ; Wed, 6 Feb 2013 15:08:38 +0400 (MSK) From: Vladimir Testov To: grub-devel@gnu.org Subject: Re: fixed item-height, item-spacing, max-elements-shown etc Date: Wed, 06 Feb 2013 15:08:37 +0400 Message-ID: <1979241.kBLIK5IbDB@icedphoenix> User-Agent: KMail/4.8.5 (Linux/3.2.0-36-generic; KDE/4.8.5; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart3944741.uMsyWgoxda" Content-Transfer-Encoding: 7Bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 217.199.216.181 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 11:08:43 -0000 --nextPart3944741.uMsyWgoxda Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Oh. One more white-space removed. That's better. -- With best regards, _______________________________ Vladimir Testov, ROSA Laboratory. www.rosalab.ru --nextPart3944741.uMsyWgoxda Content-Disposition: attachment; filename="grub2-item-height-size-fix.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="grub2-item-height-size-fix.patch" diff -Naur grub-2.00/grub-core/gfxmenu/gui_list.c grub-new/grub-core/gfxmenu/gui_list.c --- grub-2.00/grub-core/gfxmenu/gui_list.c 2011-12-14 14:36:07.000000000 +0400 +++ grub-new/grub-core/gfxmenu/gui_list.c 2013-02-06 15:06:36.620696079 +0400 @@ -228,7 +228,9 @@ grub_gfxmenu_box_t selbox = self->selected_item_box; int sel_leftpad = selbox->get_left_pad (selbox); int sel_toppad = selbox->get_top_pad (selbox); - int item_top = sel_toppad; + int sel_vertical_pad = sel_toppad + + selbox->get_bottom_pad (selbox); + int item_top = 0; int menu_index; int visible_index; struct grub_video_rect oviewport; @@ -252,9 +254,13 @@ 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); + int cheight = item_height - sel_vertical_pad; + if (cwidth < 1) + cwidth = 1; + if (cheight < 1) + cheight = 1; + selbox->set_content_size (selbox, cwidth, cheight); + selbox->draw (selbox, 0, item_top); } icon = get_item_icon (self, menu_index); @@ -391,9 +397,6 @@ int box_bottom_pad = box->get_bottom_pad (box); unsigned width_s; - grub_gfxmenu_box_t selbox = self->selected_item_box; - int sel_toppad = selbox->get_top_pad (selbox); - *width = grub_font_get_string_width (self->item_font, "Typical OS"); width_s = grub_font_get_string_width (self->selected_item_font, "Typical OS"); @@ -406,7 +409,7 @@ *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); } else { --nextPart3944741.uMsyWgoxda--