Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MwHqX-0002xA-DI for mharc-grub-devel@gnu.org; Fri, 09 Oct 2009 11:57:33 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MwHqV-0002wx-Sc for grub-devel@gnu.org; Fri, 09 Oct 2009 11:57:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MwHqQ-0002wN-VG for grub-devel@gnu.org; Fri, 09 Oct 2009 11:57:31 -0400 Received: from [199.232.76.173] (port=33023 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwHqQ-0002wK-Rs for grub-devel@gnu.org; Fri, 09 Oct 2009 11:57:26 -0400 Received: from mail-fx0-f205.google.com ([209.85.220.205]:53678) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MwHqP-0004FL-T6 for grub-devel@gnu.org; Fri, 09 Oct 2009 11:57:26 -0400 Received: by fxm1 with SMTP id 1so6024105fxm.31 for ; Fri, 09 Oct 2009 08:57:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=ep/5Y2I0mXMrlC1qwjh+dShRbvRjKGcLQQJ9qndrZ38=; b=azYQ+bhJLhsup1ICnXMfoeudjK448Ez9CgY36yrqUzwVS0F54i6dR8OpQSCxlqIOdQ 59p+rXcws/eTaW4xkXLGKn0rAbFE4kUTSiGlIn35fw0nwwltGBOzYeuY9QYMGtoVth// ztjS2HR/Mdtqt49UUcPVb+VdhmzUAYLMNxUDE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=lgbhQjwHoyHDJ4Mqz5vJPBGhSS9IFUeqyYdrIqa+GBGjhoq2/hiHcWXdx1onZLFEGF 1Cf5774xL1NCSPTJA5aJb5QVM6PkYRTK6xXfDWo/LAh2vaHIlZ9lA6O4PJ+X7fPqOYX5 VabyRSAVPpPFJRmNy0/G5L3O2Yq29oAh/cvg0= MIME-Version: 1.0 Sender: hramrach@gmail.com Received: by 10.86.240.9 with SMTP id n9mr2551282fgh.70.1255103844819; Fri, 09 Oct 2009 08:57:24 -0700 (PDT) In-Reply-To: References: Date: Fri, 9 Oct 2009 17:57:24 +0200 X-Google-Sender-Auth: 9da5bc884f24cfbe Message-ID: From: Michal Suchanek To: The development of GRUB 2 Content-Type: text/plain; charset=UTF-8 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: Fri, 09 Oct 2009 15:57:32 -0000 2009/10/9 Bean : > On Fri, Oct 9, 2009 at 10:20 PM, Michal Suchanek wr= ote: >> 2009/10/9 Bean : >>> On Fri, Oct 9, 2009 at 7:52 PM, Michal Suchanek w= rote: >>>> Yes, that's nice to name the dialog so that it can be styled more easi= ly. >>>> >>>> However, the text has no style assigned. Still the user should be able >>>> to do something like >>>> >>>> popup text { font-face: sans } >>>> >>>> or >>>> >>>> =C2=A0.dialog.mesasge text { font-face: sans } >>>> >>>> to override the font used in the dialog although the text element is >>>> not explicitly linked to any style. >>> >>> Hi, >>> >>> Oh, perhaps the name style is not very appropriate here, class may be >>> a better one. As for the sub element, it can be handle it like this: >>> >>> panel { class=3Ddialog.message text { text=3D"Hello" }} >>> >>> class >>> { >>> =C2=A0dialog.message >>> =C2=A0{ >>> =C2=A0 =C2=A0background =3D "/back.png" >>> =C2=A0 =C2=A0color=3D"blue" >>> =C2=A0} >>> } >>> >>> All widgets under the panel would looks in the dialog.message section >>> for default property, this is similar to Xterm*color in Xresource. >>> This method also make it easier to define a menu item: >>> >>> panel { class=3Dmenu.debian image {} text {}} >>> >>> class >>> { >>> =C2=A0menu.debian >>> =C2=A0{ >>> =C2=A0 =C2=A0image =3D "/debian.png" >>> =C2=A0 =C2=A0text =3D "Boot debian" >>> =C2=A0} >>> } >>> >> >> I don't understand what is what in this example. Which part is the style= here? >> >> In my mind there are two separate parts of the menu. >> >> 1) the content - text and icons separated into logical groups >> >> 2) style which specifies how these logical groups are rendered >> >> By now we have enough styling properties that adding a style to bare >> widget tree should not require meaningless elements. The unit of user >> visible focus focus is a panel and the unit of content is an edit, >> text or bitmap. >> >> It is natural then that a panel is used to group several content >> elements (text and edit or bitmap) that represent aspects of a single >> action into a single panel and group related panels (such as the boot >> menu items in current gfxterm) into a larger panel. >> >> >> The widget properties that relate to content (text, the image for >> bitmap element, command/action, key shortcut) should not be affected >> by style. Even if it is possible right now we should forbid it for >> consistency and security reasons. Localization should be applied while >> generating the layout, possibly by generating the layout in multiple >> languages and allowing to switch between languages. >> >> A style should be generally applicable to any layout (mostly) without >> any help from the layout author. You can add user styles to your >> browser to fix style problems on existing sites, for example. I think >> in grub we do not need this level of control, it's fine if loading a >> new style completely replaces (rather than amends) the previous style. >> >> Still applying a style should not rely on every element having a class >> wherever the style is to change. >> >> For example, it is not possible to identify a toplevel panel of a >> dialog without setting a class on it. On the other hand, setting a >> class on the toplevel window should suffice for styling each and every >> element of the dialog separately without any further support from the >> dialog author. Sure, marking some elements with the intended use (ie >> marking all buttons in the default layouts with the same class) would >> make the styling easier but it should not be a requirement. >> Inheritance (=3D cascading) might be a nice thing but it is not required >> when you can selectively apply style to anonymous elements. >> >> Powerful selectors make it possible to amend omissions in the layout >> you style so that you can download a style, apply it, and it just >> works on the default layout in your distribution even if it styles the >> layout differently than originally intended. =C2=A0Relying on support in >> the layout is error prone and limits style flexibility. > > Hi, > > I'm not sure what interface you're suggesting. Currently, class > property is optional, if it's not set, it would use the class name to > scan for default property, like: > > panel {} > panel { class=3Dmenu } > > class > { > =C2=A0panel {} > =C2=A0menu {} > } > I am suggesting an interface that allows style commands like style { (class=3D=3Dbutton).(text=3D=3DOK) {