The current listeners in LayoutBase (Basic Project) are for the children
of a component. Right now, if you have a Group with 10 buttons and
VerticalLayout, and you resize one of those buttons,
LayoutBase/VerticalLayout will detect that and automatically re-run the
VerticalLayout algorithm.

What I propose is to eliminate those event listeners on the children. So
if you resize one of the buttons you will have dispatch "layoutNeeded" on
the Group to get the VerticalLayout to reformat the Group.

If you resize the Group, that will continue to re-run the layout.

Another example is FirstFlexibleChildHorizontalLayout (or whatever that's
called). If you delete that first child, the layout will not run. My
change will not affect this situation - you must still dispatch
"layoutNeeded" to get the layout to recalculate the next child as the
flexible item. On the JS side, this is crucial because this layout sets
flex-grow:1 on the first child and flex-grow:0 on the rest. When you
remove the first child, all children have flex-grow:0, so you must re-run
the layout.

This is the inconsistency: sometimes you need to dispatch "layoutNeeded"
and sometimes you do not. I propose you always dispatch "layoutNeeded"
whenever you add a child, remove a child, resize a child, or do anything
that would require the layout to run.

‹peter

On 5/1/17, 10:27 AM, "piotrz" <piotrzarzyck...@gmail.com> wrote:

>Hi Peter,
>
>It look like we have partially implemented "layoutNeeded".
>
>Your suggestion in #1 - is to completely remove current listeners which
>are
>dispatch "layoutNeeded". - Am I understand correctly ? - So if I will add
>children later - those will resize itself, but in order to correct parent
>resizing it will need to dispatch "layoutNeeded" ? Am I understand
>correctly
>?
>
>In case of #2 and #3 - I think both cases are good for express components,
>but Option #3 seems to me to complicated in case of later usage.
>
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzyck...@gmail.com
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-Layout-Issue-Change-tp61440p6
>1442.html&data=02%7C01%7C%7C3f4bcd255fbb43120cbc08d4909fcd58%7Cfa7b1b5a7b3
>4438794aed2c178decee1%7C0%7C0%7C636292463395237341&sdata=stp%2Fct7tHsUCkn8
>X5ZeFclHxbyIal3vC%2F5KUoRYin4Y%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply via email to