royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-asjs] 02/03: fix button sizing
Date Fri, 23 Mar 2018 22:53:09 GMT
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit c0c595d092d1b369eb11bb94fe5c35f0d5a98da9
Author: Alex Harui <aharui@apache.org>
AuthorDate: Fri Mar 23 15:52:29 2018 -0700

    fix button sizing
---
 .../royale/mx/controls/beads/CSSImageAndTextButtonView.as   | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
index 7f9f969..7759b57 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/CSSImageAndTextButtonView.as
@@ -26,6 +26,7 @@ package mx.controls.beads
 	import flash.net.URLRequest;
 	import flash.text.TextField;
 	import flash.text.TextFieldType;
+    import flash.text.TextFieldAutoSize;
 	
     import org.apache.royale.core.BeadViewBase;
 	import org.apache.royale.core.CSSTextField;
@@ -129,6 +130,9 @@ package mx.controls.beads
 			if (textModel.html !== null)
 				html = textModel.html;
 
+            sizeTextField(upTextField);
+            sizeTextField(downTextField);
+            sizeTextField(overTextField);
             setupSkins();
 			
 			IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
@@ -136,6 +140,15 @@ package mx.controls.beads
             IEventDispatcher(_strand).addEventListener("sizeChanged",sizeChangeHandler);
 		}
 	
+        protected function sizeTextField(tf:TextField):void
+        {
+            if (tf.autoSize == TextFieldAutoSize.NONE)
+            {
+                tf.width = tf.textWidth + 4;
+                tf.height = tf.textHeight + 4;
+            }
+        }
+        
         protected function setupSkins():void
         {
             setupSkin(overSprite, overTextField, "hover");

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.

Mime
View raw message