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: Tue, 6 Oct 2009 13:33:50 +0800

On Mon, Oct 5, 2009 at 9:33 PM, Michal Suchanek <address@hidden> wrote:
> 2009/10/5 Bean <address@hidden>:
>> On Mon, Oct 5, 2009 at 5:07 PM, Michal Suchanek <address@hidden> wrote:
>>> A panel should never be removed from layout management, it then
>>> becomes pointless.
>>>
>>> A top-aligned panel should be done with alignment, and should be only
>>> possible in horizontal panels like this:
>>>
>>> panel{
>>>  direction = left_to_right
>>>  panel{ id ="bb" ;valign = center}
>>>  panel{ id ="bb" ; valign = top}
>>>  panel{ id ="bb" ; valign = bottom}
>>>  }
>>> }
>>>
>>> In a top to bottom or bottom to top the first panel is aligned to
>>> bottom/top side of the panel automatically.
>>
>> Hi,
>>
>> Actually, I just through of a possible issue with children assigned
>> alignment. For the parent panel, there is a halign property, For
>> example, if parent width is 50, each child's width is 10, there are
>> three halign values:
>>
>> halign = right
>> b1  b2  b3  empty
>> 10  10  10  20
>>
>> halign = center
>> b1  empty b2  empty  b3
>> 10    10    10     10     10
>
> This can be done with
>
>  b1     hspace   b2       hspace     b3
>  20%  20%       20%          20%   20%
>
> but why would you want such spacing?
>
> Normally you would want the panels take up most space possibly with
> some small spacing or the outer panel shrink around the inner panels.
>
>>
>> halign = right
>
> Perhaps use direction?
> Why do you want the empty space there?
>
> There are infinite possibilities of alignment so we should choose an
> alignment method that allows for commonly used alignments and perhaps
> some less common but useful, not all alignments that somebody can
> possibly think of.
>

Hi,

Consider the outer box as screen, whose size is fixed. If we want the
panels to span the whole screen instead of cluster at the left side,
then halign is quite useful, you can check out the demo to see how the
windows are placed.

>> empty b1  b2  b3
>> 20      10  10   10
>>
>> halign is obviously not belonged to children, so you might write it as:
>>
>> panel{
>>  direction = left_to_right
>>  halign = center
>>  panel{ id ="bb" ;valign = center}
>>  panel{ id ="bb" ; valign = top}
>>  panel{ id ="bb" ; valign = bottom}
>>  }
>> }
>>
>> But then there is problem, as panel can be children as well, for example:
>>
>> panel {
>>  id = "top"
>>  direction = top_to_bottom
>>
>> panel{
>>  id = "aa"
>>  direction = left_to_right
>>  halign = center
>>  panel{ id ="bb" ;valign = center}
>>  panel{ id ="bb" ; valign = top}
>>  panel{ id ="bb" ; valign = bottom}
>>  }
>> }
>> }
>>
>> In this case, should halign of aa be used to control its own alignment
>> from top, or that of its children ?
>
> It should be used to align itself, obviously as you want to control
> the alignment of each child separately and if halign = center was
> applied to all this would not be possible.

Right, perhaps it's more natural that the valign/halign are used for
the widget itself, but I still think it's useful to control parent's
alignment strategy, perhaps with a new property.

-- 
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]