You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/03/23 22:53:09 UTC
[royale-asjs] 02/03: fix button sizing
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 <ah...@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.