From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1U32Cu-0002L4-6C for mharc-grub-devel@gnu.org; Wed, 06 Feb 2013 05:26:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U32Cp-0002KP-Rk for grub-devel@gnu.org; Wed, 06 Feb 2013 05:26:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U32Cl-0001N7-05 for grub-devel@gnu.org; Wed, 06 Feb 2013 05:26:19 -0500 Received: from collab.rosalab.ru ([217.199.216.181]:49633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U32Ck-0001Ml-K7 for grub-devel@gnu.org; Wed, 06 Feb 2013 05:26:14 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by collab.rosalab.ru (Postfix) with ESMTP id 15C6829C334 for ; Wed, 6 Feb 2013 14:26:13 +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 lyaroczFxqhA for ; Wed, 6 Feb 2013 14:26:12 +0400 (MSK) Received: from icedphoenix.localnet (unknown [10.168.1.56]) by collab.rosalab.ru (Postfix) with ESMTPSA id 83F2E29C333 for ; Wed, 6 Feb 2013 14:26:12 +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 14:26:12 +0400 Message-ID: <6299254.Wc3jJadppc@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="nextPart12833850.gGBgeyBjpy" 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 10:26:22 -0000 --nextPart12833850.gGBgeyBjpy Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Here it is. :) (fixed) -- With best regards, _______________________________ Vladimir Testov, ROSA Laboratory. www.rosalab.ru --nextPart12833850.gGBgeyBjpy 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 14:11:24.536849714 +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; @@ -247,14 +249,19 @@ int is_selected = (menu_index == self->view->selected); struct grub_video_bitmap *icon; + if (is_selected) { 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 +398,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 +410,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 { --nextPart12833850.gGBgeyBjpy--