grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GITGRUB] New menu interface (implementation)


From: Bean
Subject: Re: [GITGRUB] New menu interface (implementation)
Date: Fri, 9 Oct 2009 11:45:32 +0800

On Fri, Oct 9, 2009 at 5:34 AM, Michal Suchanek <address@hidden> wrote:
> 2009/10/8 Bean <address@hidden>:
>> On Thu, Oct 8, 2009 at 7:26 PM, Michal Suchanek <address@hidden> wrote:
>>> I am not sure this is the right approach.
>>>
>>> Style writers should be free to style any widget without special
>>> support in the widget.
>>
>> Hi,
>>
>> The style property is parsed by the menu system, no special handling
>> for individual widgets.
>>
>>>
>>> If there is special styling property it should not refer to a
>>> particular visual representation. They should specify the purpose of
>>> the widget and the style should decide how widgets of that type are
>>> visually realized.
>>
>> In order to support this, I can just add recursive handling to the
>> style section, something like this:
>>
>> screen { panel { style=dialog }}
>>
>> style
>> {
>>  frame {
>>  }
>>  padding {
>>  }
>>  dialog {
>>    style=frame,padding
>>  }
>> }
>>
>
> This is backwards. At first you want some separation of model and view
> and now you want to apply style only to elements that are explicitly
> styled.
>
> Every element should have its default style which can be further
> modified by changing its properties through styling.
>
> There should be no need for the element to have any additional
> property for it to be affected by styles.
> There should be a way to assign additional identification to elements
> so that they can be affected by more specific style.
>
> In X *foreground: yellow and *background: MidnightBlue changes the
> color on each and every element for which there is no more specific
> color declaration. Similarly in CSS * { color: black ; background:
> white ;} changes the properties of all elements.
>
> The class is used only to target some elements more specifically.
> For example, in gfxterm it would be probably useful to add specific
> class (or similar property) to menu items that correspond  to linux
> kernels so that they can be styled differently from the other menu
> items.
>
> The problem with splitting text and image into separate widgets is
> that the image cannot be attached as icon property in  this case but I
> guess bitmap borders will work equally well.

Hi,

The main reason for style is to customized ui independent of code, for
example, to show a message box, we might use something like this in
code:

popup { style=dialog.message text { text="Hello" }}

Users can write a dialog.message section to customize the look of
dialog box without changing the code.

-- 
Bean

gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]