On 7/26/16, 1:58 PM, "Harbs" <harbs.li...@gmail.com> wrote:

>Two issues:
>
>1. I’m not sure I understand how SimpleCSSStyles is working. Not every
>style value is enumerated there. For example, I noticed that width and
>height are being set to styles in various places, but they are not
>enumerated.

SimpleCSSStyles and similar classes are intended to allow declarative
setting of styles in MXML.  Not every CSS style is there because otherwise
it would take a huge amount of memory per instance and most of it wouldn't
be used.  It doesn't matter which styles are defined on these classes as
long as it is the ones you want to declare in your MXML.  Folks can make
up their own derivatives of SimpleCSSStyles with a different set of
properties that suits their needs.  There is a BindableCSSStyles as well
that is need to dispatch change events if you change a style at runtime.

>2. I’m not sure I understand the flow of bead behaviors:
>
>Imagine we have a layout bead which sets and reads width and height of
>components. If the min/max sizes of the components is being set in
>another bead on the CSS, I don’t understand how the layout bead is
>supposed to know the true size of the element. If it’s not being set by
>styles, it seems like we can easily end up in a situation where the
>“constrained size bead” and the layout bead could end up playing never
>ending ping-pong. The layout bead would resize and send an event, the
>contraint bead would fix the min size and send an event, back to the
>layout bead ad infinitum.

Width/height is a special case.  It is a property as well as a style.  We
could change it to be just a style, but Flex folks are pretty used to
using width/height to read back the computed width and may not want to use
the various JS APIs.

The current VerticalLayout doesn't factor in min/max styles.  A
VerticalLayoutWithMinMax would get the CSS for min/max values, or maybe
ask measurement beads that could otherwise compute min/max values.

VerticalLayout actually doesn't read a child's width because it doesn't
need to.  Either a child's width is computed from the parent (via
left/right, margin-left/margin-right, percentWidth) or is computed from
its content.  I think once you factor in min/max you may need to think
about the width.  Like regular Flex, there are setWidth and explicitWidth
methods and properties.  setWidth does not set explicitWidth so you can
tell if folks have asked for a specific width or a width is just the last
computed width.

HTH,
-Alex

Reply via email to