From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1U8arx-0002QD-5m for mharc-grub-devel@gnu.org; Thu, 21 Feb 2013 13:27:45 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8arq-0002O4-6V for grub-devel@gnu.org; Thu, 21 Feb 2013 13:27:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8arn-0006Zt-Jz for grub-devel@gnu.org; Thu, 21 Feb 2013 13:27:38 -0500 Received: from mail-lb0-f172.google.com ([209.85.217.172]:52059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8arn-0006Zh-CC for grub-devel@gnu.org; Thu, 21 Feb 2013 13:27:35 -0500 Received: by mail-lb0-f172.google.com with SMTP id n8so7153918lbj.17 for ; Thu, 21 Feb 2013 10:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding; bh=9r3yzlbIzbpVcs8eedfxqlsHpqfmJNWsjGy3hXbOum4=; b=EpDEEvizuEmRgdc+Jnb7ckNAa8rYWxEHkj2TtSJinTinUgAPD2PBkK20Nl1SzfutbH UBxoAcDqyOlypkUvQ2jjgqT4oJWSoytGCS407SaUdmhcVzQgsp4hEXYPEp/JhduXeL/b CMEOJiIMyVaPmWy4IS27kZbIQ1yN8qZITP0+gR2s/ptvEFtuBapCz5sUNxXLe3g5b+0p nQR2R70WezPwdhDYlJO1IwkhA++hJbCq02yjMXbpvM/8QdJULwmPyIK2Mi/qQR1wKAz9 NhDy8u2VpdfvWEkJhfWKJ9mxew0ixQFdMLALObDs3jQEN4gtAyBlVKOlbYX4eG+u9FYh ph1A== X-Received: by 10.152.46.131 with SMTP id v3mr21944447lam.57.1361469370263; Thu, 21 Feb 2013 09:56:10 -0800 (PST) Received: from opensuse.site (ppp79-139-243-180.pppoe.spdop.ru. [79.139.243.180]) by mx.google.com with ESMTPS id c6sm15835900lbo.3.2013.02.21.09.56.08 (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 21 Feb 2013 09:56:09 -0800 (PST) Date: Thu, 21 Feb 2013 21:56:07 +0400 From: Andrey Borzenkov To: The development of GNU GRUB Subject: Re: fixed item-height, item-spacing, max-elements-shown etc Message-ID: <20130221215607.59adc7b3@opensuse.site> In-Reply-To: <42509525.u0FQyoZF34@icedphoenix> References: <42509525.u0FQyoZF34@icedphoenix> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.10; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.217.172 Cc: vladimir.testov@rosalab.ru 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: Thu, 21 Feb 2013 18:27:43 -0000 Sorry for delay. В Thu, 07 Feb 2013 14:07:08 +0400 Vladimir Testov пишет: > >I am not sure whether it is appropriate fix. After your patch "box > >effect" on selected item is effectively lost (it makes > >selected_item_box the same height as selected item itself). > About "box effect" - there is no "box effect" in menu_box. The menu's box is > drawn inside given area. So the idea of "box effect" was unclear to me. (Also, > the height of selected element (with box) is item_height + box_pad_top + > box_pad_bottom - 1... that "-1" makes the "box effect" totally unclear. My idea > was to make GRUB theme be countable to pixel. But it is. You know exactly which size you need. But in practice most themes would probably use dynamic sizing by specifying screen size percentage. I am not sure if grub2 currently dynamically adjusts size to ensure whole number of items fit into it. > Also, with my patch (when we can > have a box for every unselected element) item_spacing loses it's meaning > totally. It has uncertain meaning in current GRUB state too. > It is pretty much certain meaning. Of course I agree that having more detailed "style guide" for writing grub theme would definitely help. As I understand current code, it lays out quite predictably outer image top border selected item box top border item 1 inter-item space item 2 iter-item space ... item n selected item box lower border outer image lower border selected item box itself is overlayed (or, rather, underlayed). It does not change layout. So you, as theme author, has to ensure suitable space to draw selected item box so that it fits without changing existing layout. Your patch changes text layout for selected item (by reducing available space). As text is vertically aligned, this results in "jumping effect" or part of text may be cut off. In your example setting menu size to 118 provides for full 4 items + selected item box. > I thought that idea of menu's box was more valuable because it has influence to > the code. > > So, when we need to calculate exact values so the result will request our > expectations, the idea of item_height as total height is more acceptable. > selected item box is not really used to layout items. Only to adjust where the first item is placed, to allow for full top border to be displayed. Patch I just sent also adds space for lower border. Anyway, this is just my 2c. Hopefully somebody with commit rights or one of original theme authors can chime in :)