From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Mqk37-0002Yu-PC for mharc-grub-devel@gnu.org; Thu, 24 Sep 2009 04:51:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mqk33-0002Y0-Ri for grub-devel@gnu.org; Thu, 24 Sep 2009 04:51:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mqk2x-0002XC-NY for grub-devel@gnu.org; Thu, 24 Sep 2009 04:51:32 -0400 Received: from [199.232.76.173] (port=48946 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqk2x-0002X7-Hw for grub-devel@gnu.org; Thu, 24 Sep 2009 04:51:27 -0400 Received: from mail-px0-f202.google.com ([209.85.216.202]:55791) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mqk2w-0007dv-Qz for grub-devel@gnu.org; Thu, 24 Sep 2009 04:51:27 -0400 Received: by pxi40 with SMTP id 40so1507507pxi.24 for ; Thu, 24 Sep 2009 01:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Hu/XHL7sBL3IpP6rqhkB9Ppp/36wBm8qOMMfzZdit18=; b=Svjjo3r44T8rIaekW7ven8z8fjYji+xaSA5InwFqp8WXb3A+jUhrXFnPM5rAMNBMP+ RDEccy203OQlWtIgsvlUDVIXbndmELIaJ/brhYpA/KwEbJjsFfQRxZmM7AX9ztd4/1+0 oe8ptV6IzuJSK6TXnJf7E4tV5GUEw/JhZ4bNo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=R11jiyDTglG7BKE2Gfos+UlHgjH0fx9LLdv+DJEDfHw/3oTCbHcqXpT3YUiYNK+pIc AwsDCaUw/7MjP5JjEGNVcV9HJGIOOfgHzPxn2WE17h5xr8BpTzmQuB2kNE6vssr8CYBg lXifqcfEBNsYGmKJe5BkL9BkSAV2or1JWIu0Q= MIME-Version: 1.0 Received: by 10.140.148.14 with SMTP id v14mr191347rvd.26.1253782285788; Thu, 24 Sep 2009 01:51:25 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 Sep 2009 16:51:25 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [GITGRUB] New menu interface (implementation) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2009 08:51:34 -0000 On Thu, Sep 24, 2009 at 3:20 PM, Michal Suchanek wrot= e: > Hello, > > Thanks for this menu preview looks very good. > > I guess it could use more padding but if that can be added in the > style there is no problem with that. > > There is also an odd column with blue background in text mode. Is that > replacement for the icons? I guess they should not be displayed if it > is not possible to render them. Hi, The default handling for bitmap is to replace it with rect if it can't be displayed (text mode or file not found), although I can just skip it for the image in label widget. > > There is also a background glitch in graphics mode. In text mode the > background of the menu items is cyan but it is blue in graphics. It's actually the background image back.png, if you want to use color rect, change background =3D "/menu/back.png,,#808080/cyan" to background =3D ",#808080/cyan" > > 2009/9/23 Bean : >> Hi, >> >> Update: >> Add label widget >> Simple layout manager for panel widget. >> >> The resource file for new demo is uploaded at: >> http://grub4dos.sourceforge.net/menu.zip >> >> Here is the theme file for new demo: >> >> screen >> { > > This is an odd element. Can't this be another panel or just background > form the toplevel panel? > > It may be easier this way initially but getting the layout of the > inner pane right without a special element means that the layout is > actually usable at all levels. > > Also requiring a screen element makes it harder to just take a menu > and pack it inside another menu. The config file can store other information besides screen layout, for example styles. I use the screen node to locate the top widget. As for menu, it's better to move it to a different tree, and reference it in the menu widget, perhaps something like this: screen { menu { start =3D "sub_menu/bb" } } menu { item { title =3D "aa" command =3D .. } menu { title =3D "sub_menu" item { title =3D "bb" command =3D .. } item { title =3D "cc" command =3D .. } } } Then we can use and to walk the menu tree. menu widget would generate the corresponding label based on the current menu level. > >> =A0panel >> =A0{ >> =A0 =A0x =3D "5" >> =A0 =A0y =3D "5" > > What is x and y? Isn't there a more descriptive name for this property? > > Why does a panel even need x and y? x, y is the top left coordination of the widget. x,y,width,height is used to defined the position of widget, although for label, it can be omit as panel can calculate it for them. > > Typically it needs something like margin or border or padding to get > some offset between the inner elements and the outside. > > This also reminds me that there is nice way of handling pixels in text > mode - just ignore them. That places the menu inside something like > this > > http://www.gnome-look.org/CONTENT/content-files/84298-terminal.jpg > > would also look reasonably in text where the image is not displayed. > But sometimes we also need border in text mode, currently it would show bitmap in graphic mode, and a ascii box in text mode. >> >> =A0 =A0top_left =3D "/menu/menu_tl.png,,black/cyan/#0x250F" >> =A0 =A0top =3D "/menu/menu_t.png,tiling,black/cyan/#0x2501" >> =A0 =A0top_right =3D "/menu/menu_tr.png,,black/cyan/#0x2513" >> =A0 =A0left =3D "/menu/menu_l.png,tiling,black/cyan/#0x2503" >> =A0 =A0right =3D "/menu/menu_r.png,tiling,black/cyan/#0x2503" >> =A0 =A0bottom_left =3D "/menu/menu_bl.png,,black/cyan/#0x2517" >> =A0 =A0bottom =3D "/menu/menu_b.png,tiling,black/cyan/#0x2501" >> =A0 =A0bottom_right =3D "/menu/menu_br.png,tiling,black/cyan/#0x251B" >> >> =A0 =A0background =3D "/menu/back.png,,#808080/cyan" >> >> =A0 =A0label >> =A0 =A0{ >> =A0 =A0 =A0color =3D "black/cyan" >> =A0 =A0 =A0image =3D "/menu/debian.png,,blue" >> =A0 =A0 =A0title =3D "Hello Debian" >> =A0 =A0 =A0spacing =3D 1 >> =A0 =A0} >> =A0 =A0label >> =A0 =A0{ >> =A0 =A0 =A0color =3D "yellow/cyan" >> =A0 =A0 =A0image =3D "/menu/ubuntu.png,,blue" >> =A0 =A0 =A0title =3D "Hello Ubuntui (long)" >> =A0 =A0 =A0spacing =3D 1 >> =A0 =A0} >> =A0 =A0label >> =A0 =A0{ >> =A0 =A0 =A0color =3D "blue/cyan" >> =A0 =A0 =A0image =3D "/menu/gentoo.png,,blue" >> =A0 =A0 =A0title =3D "Hello Gentoo" >> =A0 =A0 =A0spacing =3D 1 >> =A0 =A0} >> =A0} >> } >> >> The x/y/width/height property is not set in label widget, they'll be >> calculated automatically by panel. The width/height property of panel >> is also skipped, which means using the minimum width/height that >> contains child widgets. >> >> The full properties of these widgets are: >> >> screen: >> background - background image >> >> panel: >> background - background image >> top_left. top, top_right, left, right, bottom_left, bottom, >> bottom_right - image for borders > > Are these meant to be borders only? > > I guess people who use something like > > http://openclipart.org/people/Anonymous/Anonymous_celtic_vine_corner.svg > > won't want the whole menu offset by the size of the image. > > Is it possible to set a border without supplying these images? For those image, just use it as background image. Perhaps sometime like thi= s: panel { background =3D "image.png" panel { x =3D 10% y =3D 10% width =3D -0 height =3D -0 .. } > > >> >> label >> font - font name >> color - font color >> image - icon image >> title - title text >> spacing - space between image and title > > I guess it would be better to change the naming a bit. > I would use 'text' rather than 'title'. The label can be used even for > plain text, not only huge captions (and there is no choice actually > because we have only a single plain font). > > 'spacing' should not be used alone. There is font spacing, line > spacing, the padding between contained elements, the padding the > padding between the contained elements and the border.... > Each should be possible to set by a property so there is clearly more > than one spacing. Right, the naming need some tuning. --=20 Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/