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/19 19:01:20 UTC

[royale-asjs] branch develop updated: proxy Panel padding to content area otherwise titlebar gets padding

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 e29c68e  proxy Panel padding to content area otherwise titlebar gets padding
e29c68e is described below

commit e29c68e54adacf3d3edb06f08ca32ccf3bd076b7
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Sep 19 12:01:03 2018 -0700

    proxy Panel padding to content area otherwise titlebar gets padding
---
 .../src/main/royale/mx/containers/Panel.as         | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

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 4884d7c..e04ea8e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
@@ -63,6 +63,7 @@ use namespace mx_internal;
 import mx.containers.beads.PanelView;
 import mx.containers.beads.models.PanelModel;
 import mx.core.Container;
+import mx.core.UIComponent;
 
 import org.apache.royale.core.IChild;
 import org.apache.royale.events.Event;
@@ -762,6 +763,67 @@ public class Panel extends Container
         return panelView.contentArea.getElementAt(index);
     }
 
+    // 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;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        return contentView.paddingLeft;
+    }
+    override public function set paddingLeft(value:Object):void
+    {
+        if (typeof(value) !== "string")
+            value = value.toString() + "px";
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        contentView.paddingLeft = value;
+    }
+    override public function get paddingRight():Object
+    {
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        return contentView.paddingRight;
+    }
+    override public function set paddingRight(value:Object):void
+    {
+        if (typeof(value) !== "string")
+            value = value.toString() + "px";
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        contentView.paddingRight = value;
+    }
+    override public function get paddingTop():Object
+    {
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        return contentView.paddingTop;
+    }
+    override public function set paddingTop(value:Object):void
+    {
+        if (typeof(value) !== "string")
+            value = value.toString() + "px";
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        contentView.paddingTop = value;
+    }
+    override public function get paddingBottom():Object
+    {
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        return contentView.paddingBottom;
+    }
+    override public function set paddingBottom(value:Object):void
+    {
+        if (typeof(value) !== "string")
+            value = value.toString() + "px";
+        var panelView:PanelView = view as PanelView;
+        var contentView:UIComponent = panelView.contentArea as UIComponent;
+        contentView.paddingBottom = value;
+    }
+
 }
 
 }