On Fri, Oct 9, 2009 at 11:57 PM, Michal Suchanek <hramr...@centrum.cz> wrote: > I am suggesting an interface that allows style commands like > > style { > > (class==button).(text==OK) { <style> } > > (class==dialog).<nothing here>.(class=button) { <style> } > > (class==buttonbar) { direction = right_to_left } > > (class==button) { > border_top = button_top > border_left = button_left > ... > } > > } > > for > > panel { class = dialog ; direction = top_to_bottom > panel { > scroll = auto > text { Blah blah blah... } > } > panel { class = buttonbar ; > panel { class = button ; img { check.png } ;text { OK } ; command = > <something> } > panel { class = button ; img { cross.png } ;text { Cancel } ; > command = <something>} > } > } > > The exact syntax and semantic of the selectors it to be defined. > > They may be imperative commands that are applied immediately to all > widgets currently in existence or they may be stored in a style > database that widgets consult each time they are drawn or some > combination of the above (for example the style commands affect a > style database in order of appearance but do not affect widgets > directly). > > I guess the styles that appear in the main config (grub.cfg or loaded > by loadcfg) should be added together so that scripts that generate > different parts of the file can add style bits for their widgets. > > loadstyle command should reset all widget style properties to default > (either widget default or the state after loading config) and then > interpret the content of the file as if it was enclosed in style {}. > > When loadstyle is repeated the widgets should be reset again so that > previous style cannot affect the newly loaded style.
Hi, Perhaps it can be written like this: class { button.text_OK { <style>} dialog.*button { <style> } buttonbar { direction = right_to_left } button { border_top = button_top border_left = button_left } } panel { class = dialog ; direction = top_to_bottom panel { scroll = auto text { Blah blah blah... } } panel { class = buttonbar ; panel { class = button ; img { check.png } ;text { class=text_OK } ; command =<something> } panel { class = button ; img { cross.png } ;text { class=text_Cancel } ; command = <something>} } } -- Bean gitgrub home: http://github.com/grub/grub/ my fork page: http://github.com/bean123/grub/ _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel