This is an automated email from the ASF dual-hosted git repository. carlosrovira pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit b4e09d43230cf743862166f36a520cb73bf3eb2f Author: Carlos Rovira <carlos.rov...@apache.org> AuthorDate: Sun Jun 7 21:34:03 2020 +0200 jewel-layouts: remove obligatory children "sizeChanged" event in all case. Use now new bead "LaoutChildren" when needed --- .../royale/jewel/beads/layouts/BasicLayout.as | 21 +-------------------- .../royale/jewel/beads/layouts/GridLayout.as | 2 -- .../royale/jewel/beads/layouts/HorizontalLayout.as | 4 +--- .../jewel/beads/layouts/SimpleHorizontalLayout.as | 22 +--------------------- .../jewel/beads/layouts/SimpleVerticalLayout.as | 20 -------------------- .../jewel/beads/layouts/TileHorizontalLayout.as | 2 +- .../jewel/beads/layouts/TileVerticalLayout.as | 2 +- .../royale/jewel/beads/layouts/VerticalLayout.as | 2 -- 8 files changed, 5 insertions(+), 70 deletions(-) diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as index 223fb5e..53bdfda 100644 --- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/BasicLayout.as @@ -18,14 +18,11 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.royale.jewel.beads.layouts { - COMPILE::JS { - import org.apache.royale.core.UIBase; - } COMPILE::SWF { import org.apache.royale.core.IUIBase; import org.apache.royale.core.ILayoutChild; - } import org.apache.royale.core.ILayoutView; + } import org.apache.royale.events.Event; /** @@ -86,7 +83,6 @@ package org.apache.royale.jewel.beads.layouts /** * @copy org.apache.royale.core.IBeadLayout#layout - * @royaleignorecoercion org.apache.royale.core.UIBase */ override public function layout():Boolean { @@ -221,21 +217,6 @@ package org.apache.royale.jewel.beads.layouts * position: absolute * } */ - - // We just need to make chids resize themselves (through `sizeChanged` event) - var contentView:ILayoutView = layoutView; - var n:int = contentView.numElements; - var child:UIBase; - - if (n == 0) return false; - - for(var i:int=0; i < n; i++) { - child = contentView.getElementAt(i) as UIBase; - if (!child) - continue; - child.dispatchEvent('sizeChanged'); - } - return true; } } diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridLayout.as index f32d177..2c1c20e 100644 --- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridLayout.as +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridLayout.as @@ -200,8 +200,6 @@ package org.apache.royale.jewel.beads.layouts * padding: 1em 0 0 1em; * } */ - super.layout(); - return true; } } diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as index 3ffaeb2..8ebdb22 100644 --- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/HorizontalLayout.as @@ -333,9 +333,7 @@ package org.apache.royale.jewel.beads.layouts } COMPILE::JS { - super.layout(); - - return true; + return true; } } } diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as index 06f09e4..529302a 100644 --- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleHorizontalLayout.as @@ -27,11 +27,6 @@ package org.apache.royale.jewel.beads.layouts import org.apache.royale.core.ValuesManager; import org.apache.royale.core.layout.EdgeData; } - COMPILE::JS - { - import org.apache.royale.core.ILayoutView; - import org.apache.royale.core.UIBase; - } import org.apache.royale.events.Event; import org.apache.royale.jewel.beads.layouts.StyledLayoutBase; @@ -196,22 +191,7 @@ package org.apache.royale.jewel.beads.layouts * .layout.horizontal > * { * flex: 0 0 auto * } - */ - - // We just need to make chids resize themselves (through `sizeChanged` event) - var contentView:ILayoutView = layoutView; - var n:int = contentView.numElements; - var child:UIBase; - - if (n == 0) return false; - - for(var i:int=0; i < n; i++) { - child = contentView.getElementAt(i) as UIBase; - if (!child) - continue; - child.dispatchEvent('sizeChanged'); - } - + */ return true; } } diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as index ffbe408..ee7a292 100644 --- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/SimpleVerticalLayout.as @@ -27,11 +27,6 @@ package org.apache.royale.jewel.beads.layouts import org.apache.royale.core.ValuesManager; import org.apache.royale.core.layout.EdgeData; } - COMPILE::JS - { - import org.apache.royale.core.ILayoutView; - import org.apache.royale.core.UIBase; - } import org.apache.royale.events.Event; import org.apache.royale.jewel.beads.layouts.StyledLayoutBase; @@ -198,21 +193,6 @@ package org.apache.royale.jewel.beads.layouts * flex: 0 1 auto * } */ - - // We just need to make chids resize themselves (through `sizeChanged` event) - var contentView:ILayoutView = layoutView; - var n:int = contentView.numElements; - var child:UIBase; - - if (n == 0) return false; - - for(var i:int=0; i < n; i++) { - child = contentView.getElementAt(i) as UIBase; - if (!child) - continue; - child.dispatchEvent('sizeChanged'); - } - return true; } } diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileHorizontalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileHorizontalLayout.as index 3c5c8b9..72abbf1 100644 --- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileHorizontalLayout.as +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileHorizontalLayout.as @@ -500,7 +500,7 @@ package org.apache.royale.jewel.beads.layouts else child.positioner.style.marginRight = null; - child.dispatchEvent('sizeChanged'); + child.dispatchEvent(new Event('sizeChanged')); } return true; } diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileVerticalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileVerticalLayout.as index b953c1b..cf0bcbe 100644 --- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileVerticalLayout.as +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileVerticalLayout.as @@ -473,7 +473,7 @@ package org.apache.royale.jewel.beads.layouts // else // child.positioner.style.marginRight = null; - child.dispatchEvent('sizeChanged'); + child.dispatchEvent(new Event('sizeChanged')); } return true; } diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as index b714911..ffcdb2b 100644 --- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/VerticalLayout.as @@ -334,8 +334,6 @@ package org.apache.royale.jewel.beads.layouts } COMPILE::JS { - super.layout(); - return true; } }