parent the titlebar and content area sooner so their children can calculate 
size correctly


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/93e26655
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/93e26655
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/93e26655

Branch: refs/heads/release0.8.0
Commit: 93e266557f8992b504c76a7058d9da650b4da06a
Parents: 531c9e1
Author: Alex Harui <[email protected]>
Authored: Wed Jun 7 22:46:31 2017 -0700
Committer: Alex Harui <[email protected]>
Committed: Wed Jun 7 23:23:05 2017 -0700

----------------------------------------------------------------------
 .../org/apache/flex/html/beads/PanelView.as     | 22 +++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/93e26655/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/PanelView.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/PanelView.as
 
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/PanelView.as
index da34924..d3ff5cb 100644
--- 
a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/PanelView.as
+++ 
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/PanelView.as
@@ -158,6 +158,9 @@ package org.apache.flex.html.beads
                        // any changes to values in the Panel's model that 
correspond values in the TitleBar will
                        // be picked up automatically by the TitleBar.
                        titleBar.model = host.model;
+                       if (titleBar.parent == null) {
+                               (_strand as Panel).$addElement(titleBar);
+                       }
 
                        if (!_contentArea) {
                                _contentArea = new Container();
@@ -209,6 +212,10 @@ package org.apache.flex.html.beads
                                _contentArea.addBead(viewportBead);
                        }
 
+                       if (contentArea.parent == null) {
+                               (_strand as Panel).$addElement(contentArea as 
IChild);
+                       }
+
                        // Now give the Panel its own layout
                        layoutBead = new VerticalFlexLayout();
                        value.addBead(layoutBead);
@@ -237,13 +244,6 @@ package org.apache.flex.html.beads
 
                override protected function completeSetup():void
                {
-                       if (titleBar.parent == null) {
-                               (_strand as Panel).$addElement(titleBar);
-                       }
-                       if (contentArea.parent == null) {
-                               (_strand as Panel).$addElement(contentArea as 
IChild);
-                       }
-
                        super.completeSetup();
                        
                        performLayout(null);
@@ -264,5 +264,13 @@ package org.apache.flex.html.beads
                        _contentArea.dispatchEvent(new Event("layoutNeeded"));
                        performLayout(event);
                }
+               
+               COMPILE::SWF
+               override protected function calculateContentSize():Size
+               {
+                       var size:Size = super.calculateContentSize();
+                       size.height += titleBar.height;
+                       return size;
+               }
        }
 }

Reply via email to