From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UPHAE-0001bL-Lt for mharc-grub-devel@gnu.org; Mon, 08 Apr 2013 14:51:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPHA6-0001Zf-Uq for grub-devel@gnu.org; Mon, 08 Apr 2013 14:51:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPHA0-0004Ip-NU for grub-devel@gnu.org; Mon, 08 Apr 2013 14:51:26 -0400 Received: from mail-ee0-f47.google.com ([74.125.83.47]:50262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPHA0-0004IV-GP for grub-devel@gnu.org; Mon, 08 Apr 2013 14:51:20 -0400 Received: by mail-ee0-f47.google.com with SMTP id t10so2463229eei.6 for ; Mon, 08 Apr 2013 11:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=gDlwx8YL5sVWRcf00NDXLTBAx8aTGUqgSBMgPCyMqyM=; b=kh3xoPDkdn2QvFpXgQWR9M2tPyKUipxsUggEhVZcunIvtnmx4PzGGXQ77hJeHxlwus I4iNDCVgLOZBUQmumajm9YpVCN6FPl83UJfWRPA2CU+i6DOz8FgeC7SoH4Xvjkn8TT7V xDfgyILF02f4Y80R8e16teXMrR+oF1M3O7fo/mNbWatU/G87zqcJVbYGZx4dI2T6YhF+ AvYMzTvPfxp22DVkrfm/52q+O5nGc9BIB6iMWCi5w6mSEja/oZlanWrFv6ylZJPCGs/d biAbSuL4NaO17Iq+q2RFgQHWckxfuAmcSzYa93HDA39Z7yZN0owLDgDAZtf4uq4nhTVA h6BQ== X-Received: by 10.14.1.130 with SMTP id 2mr51475803eed.15.1365447079524; Mon, 08 Apr 2013 11:51:19 -0700 (PDT) Received: from debian.x201.phnet (245-188.1-85.cust.bluewin.ch. [85.1.188.245]) by mx.google.com with ESMTPS id t4sm33742449eel.0.2013.04.08.11.51.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 11:51:18 -0700 (PDT) Message-ID: <516311A5.3090506@gmail.com> Date: Mon, 08 Apr 2013 20:51:17 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] fix menu size calculation in presence of selected item pixmap References: <1361468201-26961-1-git-send-email-arvidjaar@gmail.com> In-Reply-To: <1361468201-26961-1-git-send-email-arvidjaar@gmail.com> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigBB32181F46DC5655D4090872" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.83.47 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: Mon, 08 Apr 2013 18:51:33 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBB32181F46DC5655D4090872 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21.02.2013 18:36, Andrey Borzenkov wrote: > draw_menu() acconted for upper border of selected item pixmap, but not > for lower. So it could happen that lower border was visually cut off. >=20 > Also various calculations of menu vertical size did not account for > space for lower border >=20 > Signed-off-by: Andrey Borzenkov >=20 > --- > grub-core/gfxmenu/gui_list.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) >=20 > diff --git a/grub-core/gfxmenu/gui_list.c b/grub-core/gfxmenu/gui_list.= c > index 1982d9a..5c83383 100644 > --- a/grub-core/gfxmenu/gui_list.c > +++ b/grub-core/gfxmenu/gui_list.c > @@ -97,8 +97,14 @@ get_num_shown_items (list_impl_t self) > grub_gfxmenu_box_t box =3D self->menu_box; > int box_top_pad =3D box->get_top_pad (box); > int box_bottom_pad =3D box->get_bottom_pad (box); > + > + grub_gfxmenu_box_t selbox =3D self->selected_item_box; > + int sel_top_pad =3D selbox->get_top_pad (selbox); > + int sel_bottom_pad =3D selbox->get_bottom_pad (selbox); > + =20 > =20 > return (self->bounds.height + item_vspace - 2 * boxpad > + - sel_top_pad - sel_bottom_pad I don't see the logic behind this. item_top in draw_menu doesn't increase more on selected item than on any other one. > - box_top_pad - box_bottom_pad) / (item_height + item_vspace); > } > =20 > @@ -392,7 +398,8 @@ list_get_minimal_size (void *vself, unsigned *width= , unsigned *height) > unsigned width_s; > =20 > grub_gfxmenu_box_t selbox =3D self->selected_item_box; > - int sel_toppad =3D selbox->get_top_pad (selbox); > + int sel_top_pad =3D selbox->get_top_pad (selbox); > + int sel_bottom_pad =3D selbox->get_bottom_pad (selbox); > =20 > *width =3D grub_font_get_string_width (self->item_font, "Typical= OS"); > width_s =3D grub_font_get_string_width (self->selected_item_font= , > @@ -406,7 +413,7 @@ list_get_minimal_size (void *vself, unsigned *width= , unsigned *height) > *height =3D (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_bo= ttom_pad); > } > else > { --------------enigBB32181F46DC5655D4090872 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAlFjEaUACgkQNak7dOguQgl/WAEAgibk+5xgX/yL0toEPoNNsiSs ywvSHOuINlGQ6FrBYckBAIM4m0396sDj+ZzMJZWoLCGypXEHFnvywJsp/72Nx6mC =T7w2 -----END PGP SIGNATURE----- --------------enigBB32181F46DC5655D4090872--