You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/09/28 17:31:41 UTC

[royale-asjs] branch develop updated: fix panel layout

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 33423bb  fix panel layout
33423bb is described below

commit 33423bbf7b5bf9ab58cc4d4bb8e883e422ed3573
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Sep 28 10:23:21 2018 -0700

    fix panel layout
---
 .../src/main/royale/mx/containers/Panel.as         | 34 +++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
index 418e54a..657ef72 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
@@ -767,7 +767,6 @@ public class Panel extends Container
     // override and proxy to content area.  Otherwise Panel's TitleBar and other chrome will
     // have this padding between the border and chrome
     
-    
     override public function get paddingLeft():Object
     {
         var panelView:PanelView = view as PanelView;
@@ -825,6 +824,39 @@ public class Panel extends Container
         contentView.paddingBottom = value;
     }
     
+    // because padding creates the view early, the setuplayout logic
+    // may get run before percentWidth/Height are set, so we have
+    // to make sure the contentArea gets set up correctly
+    override public function set percentWidth(value:Number):void
+    {
+        super.percentWidth = value;
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        contentView.percentWidth = 100;
+    }
+    override public function set explicitWidth(value:Number):void
+    {
+        super.explicitWidth = value;
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        contentView.percentWidth = 100;
+    }
+    override public function set percentHeight(value:Number):void
+    {
+        super.percentHeight = value;
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        contentView.percentHeight = 100;
+    }
+    override public function set explicitHeight(value:Number):void
+    {
+        super.explicitHeight = value;
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        contentView.percentHeight = 100;
+    }
+    
+
     /**
      *  @private
      */