This is an automated email from the ASF dual-hosted git repository.
yishayw 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 0d9a3e9355 Fix #1208
0d9a3e9355 is described below
commit 0d9a3e9355b65210bf785f959ef76a30953cb2bf
Author: Yishay Weiss <[email protected]>
AuthorDate: Mon Sep 5 15:36:35 2022 +0300
Fix #1208
---
.../main/royale/mx/containers/beads/PanelView.as | 29 +++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
index 7e74067443..4dd00f4b49 100644
---
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/beads/PanelView.as
@@ -141,9 +141,8 @@ public class PanelView extends
org.apache.royale.html.beads.PanelView
contentArea.percentHeight = 100;
// Now give the Panel its own layout
- var boxLayout:BoxLayout = new BoxLayout();
- boxLayout.direction = "vertical";
- _strand.addBead(boxLayout);
+ var panelLayout:PanelLayout = new PanelLayout();
+ _strand.addBead(panelLayout);
}
/**
@@ -166,3 +165,27 @@ public class PanelView extends
org.apache.royale.html.beads.PanelView
}
}
+
+import mx.core.UIComponent;
+import mx.containers.Panel;
+import org.apache.royale.core.LayoutBase;
+
+class PanelLayout extends LayoutBase
+{
+ override public function layout():Boolean
+ {
+ var panel:Panel = host as Panel;
+ var titleBar:UIComponent = panel.$getElementAt(0) as UIComponent;
+ var content:UIComponent = panel.$getElementAt(1) as UIComponent;
+ var w:Number = panel.width;
+ var h:Number = panel.height;
+ if (panel.isWidthSizedToContent())
+ w = content.width + 2;
+ if (panel.isHeightSizedToContent())
+ h = content.height + 2 + titleBar.getExplicitOrMeasuredHeight();
+ titleBar.setActualSize(w - 2, titleBar.getExplicitOrMeasuredHeight());
+ content.setActualSize(w - 2, h - titleBar.height - 2 - 1);
+ content.move(0, titleBar.height + 1);
+ return false;
+ }
+}
\ No newline at end of file