flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [05/36] git commit: [flex-asjs] [refs/heads/develop] - allow pseudo-state specific styles
Date Tue, 28 Jul 2015 18:40:31 GMT
allow pseudo-state specific styles


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

Branch: refs/heads/develop
Commit: c9c90ffb67dd729ffa5797bab6d3373b5a07c77c
Parents: 30007f7
Author: Alex Harui <aharui@apache.org>
Authored: Mon Jul 13 21:53:47 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Mon Jul 13 21:53:47 2015 -0700

----------------------------------------------------------------------
 .../as/src/org/apache/flex/core/CSSTextField.as | 40 +++++++++++++-------
 1 file changed, 26 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c9c90ffb/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
index a91174d..41ff87c 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
@@ -18,11 +18,11 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.core
 {
-	import flash.text.TextField;
-	import flash.text.TextFieldAutoSize;
-	import flash.text.TextFormat;
-	
-	import org.apache.flex.core.ValuesManager;
+    import flash.text.TextField;
+    import flash.text.TextFieldAutoSize;
+    import flash.text.TextFormat;
+    
+    import org.apache.flex.core.ValuesManager;
     import org.apache.flex.events.Event;
     import org.apache.flex.utils.CSSUtils;
 		
@@ -65,6 +65,17 @@ package org.apache.flex.core
 		
         /**
          *  @private
+         *  The CSS pseudo-state for lookups.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public var styleState:String;
+        
+        /**
+         *  @private
          *  The parentDrawsBackground property is set if the CSSTextField
          *  shouldn't draw a background
          *
@@ -98,19 +109,19 @@ package org.apache.flex.core
 			sp.addEventListener("classNameChanged", updateStyles);
             
 			var tf: TextFormat = new TextFormat();
-			tf.font = ValuesManager.valuesImpl.getValue(sp, "fontFamily") as String;
-			tf.size = ValuesManager.valuesImpl.getValue(sp, "fontSize");
-			tf.bold = ValuesManager.valuesImpl.getValue(sp, "fontWeight") == "bold";
-			tf.color = CSSUtils.toColor(ValuesManager.valuesImpl.getValue(sp, "color"));
+			tf.font = ValuesManager.valuesImpl.getValue(sp, "fontFamily", styleState) as String;
+			tf.size = ValuesManager.valuesImpl.getValue(sp, "fontSize", styleState);
+			tf.bold = ValuesManager.valuesImpl.getValue(sp, "fontWeight", styleState) == "bold";
+			tf.color = CSSUtils.toColor(ValuesManager.valuesImpl.getValue(sp, "color", styleState));
             if (!parentHandlesPadding)
             {
-        		var padding:Object = ValuesManager.valuesImpl.getValue(sp, "padding");
-        		var paddingLeft:Object = ValuesManager.valuesImpl.getValue(sp,"padding-left");
-        		var paddingRight:Object = ValuesManager.valuesImpl.getValue(sp,"padding-right");
+        		var padding:Object = ValuesManager.valuesImpl.getValue(sp, "padding", styleState);
+        		var paddingLeft:Object = ValuesManager.valuesImpl.getValue(sp,"padding-left", styleState);
+        		var paddingRight:Object = ValuesManager.valuesImpl.getValue(sp,"padding-right",
styleState);
         		tf.leftMargin = CSSUtils.getLeftValue(paddingLeft, padding, width);
         		tf.rightMargin = CSSUtils.getRightValue(paddingRight, padding, width);
             }
-            var align:Object = ValuesManager.valuesImpl.getValue(sp, "text-align");
+            var align:Object = ValuesManager.valuesImpl.getValue(sp, "text-align", styleState);
             if (align == "center")
 			{
 				autoSize = TextFieldAutoSize.NONE;
@@ -123,7 +134,7 @@ package org.apache.flex.core
 			}
             if (!parentDrawsBackground)
             {
-                var backgroundColor:Object = ValuesManager.valuesImpl.getValue(sp, "background-color");
+                var backgroundColor:Object = ValuesManager.valuesImpl.getValue(sp, "background-color",
styleState);
                 if (backgroundColor != null)
                 {
                     this.background = true;
@@ -139,5 +150,6 @@ package org.apache.flex.core
             // force styles to be re-calculated
             this.text = text;
         }
+        
 	}
 }
\ No newline at end of file


Mime
View raw message