You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2018/08/23 08:19:53 UTC

[GitHub] Harbs commented on a change in pull request #274: itemsExpand still not work, fix again

Harbs commented on a change in pull request #274: itemsExpand still not work, fix again
URL: https://github.com/apache/royale-asjs/pull/274#discussion_r212220552
 
 

 ##########
 File path: frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/StyledLayoutBase.as
 ##########
 @@ -77,6 +79,58 @@ package org.apache.royale.jewel.beads.layouts
 			{
 				hostComponent = host as UIBase;
 				hostClassList = hostComponent.positioner.classList;
+
+				initStyleToLayout(hostComponent, "itemsExpand");
+				setHostClassList("itemsExpand", _itemsExpand ? "itemsExpand":"");
+
+				initStyleToLayout(hostComponent, "itemsHorizontalAlign");
+				setHostClassList(_itemsHorizontalAlign, _itemsHorizontalAlign);
+
+				initStyleToLayout(hostComponent, "itemsVerticalAlign");
+				setHostClassList(_itemsVerticalAlign, _itemsVerticalAlign);
+			}
+		}
+
+		/**
+		 *  Get the component layout style and init to if exists
+		 * 
+		 *  @param component the IUIBase component that host this layout
+		 *  @param cssProperty the style property in css set for the component to retrieve
+		 * 
+ 		 *  @langversion 3.0
+ 		 *  @playerversion Flash 10.2
+ 		 *  @playerversion AIR 2.6
+ 		 *  @productversion Royale 0.9.3
+ 		 */
+		protected function initStyleToLayout(component:IUIBase, cssProperty:String):void
+		{	
+			///-----------------------------------------
+			/// This function works as the same as 
+			/// org.apache.royale.core.layout.ILayoutStyleProperties#applyStyleToLayout(component:IUIBase, cssProperty:String):void
+			/// Because StyledLayoutBase does not implement ILayoutStyleProperties
+			/// To avoid conflict with subclass like HorizontalLayout.applyStyleToLayout
+			/// Names this function - initStyleToLayout
+			///-----------------------------------------
+			var cssValue:* = ValuesManager.valuesImpl.getValue(component, cssProperty);
+			if (cssValue !== undefined)
+			{
+				switch(cssProperty)
+				{
+					case "itemsExpand":
+						if(!itemsExpandInitialized)
+							itemsExpand = Boolean(cssValue);
 
 Review comment:
   Boolean("false") will result in true...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services