pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: The patchwork that is Pivot layout
Date Fri, 18 Mar 2011 14:41:10 GMT
>> In order to wrap, a component needs a width constraint. The "fill" flag allows us
to use the width of the BoxPane as this constraint. Otherwise, how would we know what the
wrap width should be? The only other way to do it would be to assign an explicit preferred
width to the component.
> In layout(), we have a width constraint we could use, which is the width that has been
allocated to us.

How is that different from the current behavior? That's exactly what "fill" does.

>> That sounds similar to what Bill described. But, as I mentioned earlier, Pivot doesn't
define horizontal or vertical alignment properties on the Component class. Layout customization
properties are defined by the container, not the child component. The only input a child component
has into the layout process is preferred size.
> ImageViewSkin and LabelSkin already have "child" properties like this.

Maybe I misunderstood your suggestion:

>>> Alignment and fill would affect how the bordered component sits within the space
allocated by the parent container.

What is "the parent container" in this case? If it is the Border itself, then yes, those properties
would be consistent with ImageView, Label, Border, etc. But that brings me back to my previous
point - I don't think the use case for customizing alignment within a Border is particularly
strong. There are two primary use cases for a Border:

1) You want the content to fill the border's bounds, and you want the border to grow/shrink
with the content's preferred size.

2) You want the border to have some fixed size, and you want the content to be scrollable
if it exceeds the size of the border.

In case #1, an alignment style would be useless since it would always be ignored. In case
#2, you'll need to put a scroll pane in the border and make the actual content a child of
the scroll pane, so the alignment styles would be ignored here too.

View raw message