2009/10/6 Bean <bean12...@gmail.com>: > On Mon, Oct 5, 2009 at 9:33 PM, Michal Suchanek <hramr...@centrum.cz> wrote: >> 2009/10/5 Bean <bean12...@gmail.com>: >>> On Mon, Oct 5, 2009 at 5:07 PM, Michal Suchanek <hramr...@centrum.cz> 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.
You wrap them in a panel and center that. If there is any content that would use the space it uses it. If not they stay in the center. If you really insist on spreading several panels over the screen I suggest panel properties that solve this problem: homogenous and stretch. homogenous allocates equal space to each child regardless of its size. Child alignment strategy can then be used to determine where to put the child in the allocated space in case it is larger/smaller than required. stretch inserts equal spacing between its children. This could be possibly a special spacing value. Given that we have unidirectional panels now perhaps we should reduce vspace/hspace to a single property. > >>> 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. We already have properties for controlling this strategy: - direction - hspace/vspace (spacing) - inner_space (padding) - outer_space on the children (margin) Thanks Michal _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel