flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [01/50] git commit: [flex-asjs] [refs/heads/tlf] - overflow layouts should watch parent container for changes. In overflow layouts the parent may not ask the child to re-layout since the child's size may not change since we set it to cause overflow
Date Tue, 30 May 2017 19:47:36 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/tlf db09eae8e -> f131187cd


overflow layouts should watch parent container for changes.  In overflow layouts the parent
may not ask the child to re-layout since the child's size may not change since we set it to
cause overflow


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

Branch: refs/heads/tlf
Commit: 1e450bb751e1dad52605a10909e0954a20ffb565
Parents: f05a94f
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 23 00:15:48 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue May 23 00:15:57 2017 -0700

----------------------------------------------------------------------
 ...eFlexibleChildHorizontalLayoutForOverflow.as | 19 ++++++++++++++++++-
 ...OneFlexibleChildVerticalLayoutForOverflow.as | 20 +++++++++++++++++++-
 2 files changed, 37 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e450bb7/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
index c6abc22..027f2ee 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayoutForOverflow.as
@@ -30,6 +30,7 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.geom.Rectangle;
 	import org.apache.flex.utils.CSSContainerUtils;
 	import org.apache.flex.utils.CSSUtils;
@@ -64,7 +65,23 @@ package org.apache.flex.html.beads.layouts
 		{
 			super();
 		}
+		
+        /**
+         *  @flexjsignorecoercion org.apache.flex.events.IEventDispatcher;
+         */
+		COMPILE::JS
+		override public function set strand(value:IStrand):void
+		{
+			super.strand = value;
+			(host.parent as IEventDispatcher).addEventListener("sizeChanged", parentSizeChangedHandler);
+		}
 
+		COMPILE::JS
+		private function parentSizeChangedHandler(event:Event):void
+		{
+			performLayout();	
+		}
+		
         private var _flexibleChild:String;
 
         protected var actualChild:ILayoutChild;
@@ -115,7 +132,7 @@ package org.apache.flex.html.beads.layouts
 					child.element.style["display"] = "inline-block";
 			}
 
-			var w:Number = host.width;
+			var w:Number = host.width - 1;
 			for(i=0; i < n; i++) {
 				child = contentView.getElementAt(i) as UIBase;
 				if (child != actualChild)

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e450bb7/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
index 5679f80..f9f0b1d 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayoutForOverflow.as
@@ -31,6 +31,7 @@ package org.apache.flex.html.beads.layouts
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.geom.Rectangle;
 	import org.apache.flex.utils.CSSContainerUtils;
 	import org.apache.flex.utils.CSSUtils;
@@ -66,6 +67,23 @@ package org.apache.flex.html.beads.layouts
 			super();
 		}
 
+	
+        /**
+         *  @flexjsignorecoercion org.apache.flex.events.IEventDispatcher;
+         */
+		COMPILE::JS
+		override public function set strand(value:IStrand):void
+		{
+			super.strand = value;
+			(host.parent as IEventDispatcher).addEventListener("sizeChanged", parentSizeChangedHandler);
+		}
+
+		COMPILE::JS
+		private function parentSizeChangedHandler(event:Event):void
+		{
+			performLayout();	
+		}
+
         private var _flexibleChild:String;
 
         protected var actualChild:ILayoutChild;
@@ -116,7 +134,7 @@ package org.apache.flex.html.beads.layouts
 					child.element.style["display"] = "block";
 			}
 
-			var h:Number = host.height;
+			var h:Number = host.height - 1;
 			for(i=0; i < n; i++) {
 				child = contentView.getElementAt(i) as UIBase;
 				if (child != actualChild)


Mime
View raw message