You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/05/18 13:33:10 UTC

[royale-asjs] branch develop updated: icons: FontAwesome must use "text" instead of custom "type" so components using Icon interface can use one ot the other (like IconButtonItemRenderer)

This is an automated email from the ASF dual-hosted git repository.

carlosrovira 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 4763103  icons: FontAwesome must use "text" instead of custom "type" so components using Icon interface can use one ot the other (like IconButtonItemRenderer)
4763103 is described below

commit 4763103acd5f5b6e6a1adf4ff5e22972e34afab1
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon May 18 15:33:04 2020 +0200

    icons: FontAwesome must use "text" instead of custom "type" so components using Icon interface can use one ot the other (like IconButtonItemRenderer)
---
 .../org/apache/royale/icons/FontAwesomeIcon.as     | 15 +++++----------
 .../apache/royale/icons/FontAwesomeToggleIcon.as   | 22 +++++++++++-----------
 2 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/frameworks/projects/Icons/src/main/royale/org/apache/royale/icons/FontAwesomeIcon.as b/frameworks/projects/Icons/src/main/royale/org/apache/royale/icons/FontAwesomeIcon.as
index 74cba36..4744375 100644
--- a/frameworks/projects/Icons/src/main/royale/org/apache/royale/icons/FontAwesomeIcon.as
+++ b/frameworks/projects/Icons/src/main/royale/org/apache/royale/icons/FontAwesomeIcon.as
@@ -129,7 +129,6 @@ package org.apache.royale.icons
             setUpClassName();
 		}
         
-        protected var _type:String;
         /**
          *  the icon type. This field is required.
          *
@@ -138,16 +137,12 @@ package org.apache.royale.icons
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.9.7
          */
-        public function get type():String
-        {
-            return _type;
-        }
-		public function set type(value:String):void
+        override public function set text(value:String):void
 		{
-            removeClass('fa-' + _type);
-            _type = value;
-            if(_type)
-                addClass('fa-' + _type);
+            removeClass('fa-' + _text);
+            _text = value;
+            if(_text)
+                addClass('fa-' + _text);
 		}
 
         protected var _pullRight:Boolean;
diff --git a/frameworks/projects/Icons/src/main/royale/org/apache/royale/icons/FontAwesomeToggleIcon.as b/frameworks/projects/Icons/src/main/royale/org/apache/royale/icons/FontAwesomeToggleIcon.as
index 16415cb..0a37394 100644
--- a/frameworks/projects/Icons/src/main/royale/org/apache/royale/icons/FontAwesomeToggleIcon.as
+++ b/frameworks/projects/Icons/src/main/royale/org/apache/royale/icons/FontAwesomeToggleIcon.as
@@ -110,9 +110,9 @@ package org.apache.royale.icons
             internalSelected();
         }
 
-        private var _selectedType:String = "";
+        private var _selectedText:String = "";
         /**
-         *  The icon selectedType. This is optional.
+         *  The icon selectedText. This is optional.
          *  If not set, defaults to type
          *  
          *  @langversion 3.0
@@ -120,25 +120,25 @@ package org.apache.royale.icons
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.9.7
          */
-		public function get selectedType():String
+		public function get selectedText():String
 		{
-            return _selectedType;            
+            return _selectedText;            
 		}
-        public function set selectedType(value:String):void
+        public function set selectedText(value:String):void
 		{
-            _selectedType = value;
+            _selectedText = value;
             internalSelected();
 		}
 
         private function internalSelected():void
         {
-            removeClass('fa-' + _type);
-            removeClass('fa-' + _selectedType);
+            removeClass('fa-' + _text);
+            removeClass('fa-' + _selectedText);
 
-            if(_selectedType == "")
-                _selectedType = _type;
+            if(_selectedText == "")
+                _selectedText = _text;
 
-            var cls:String = selected ? _selectedType : _type;
+            var cls:String = selected ? _selectedText : _text;
             if(cls != "")
                 addClass('fa-' + cls);