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/06/15 17:23:46 UTC

[royale-asjs] branch develop updated (f4524fb -> e52c07a)

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

carlosrovira pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


    from f4524fb  changed version number
     new 8e9dca5  jewel-grid: simplify code
     new eaaddbb  core-itextbutton interface
     new 2023bcd  jewel-inputbuttonzise: move toitsown button package
     new 072c7e0  jewel-responsivesize: simplify code and make it extendable
     new cb8dde4  jewel-button: add ITextButton interface to buttons with text label (included checkbox and radiobutton) and make text label use a span to make it more usable
     new 509b447  jewel-responsive-label-visibiility: add resoposive visibility for text labelsin buttons
     new 3114904  jewel-button: padding between text and icon is now applied to text instead to icon
     new e52c07a  Merge branch 'feature/responsive-button-labels' into develop

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../projects/Core/src/main/royale/CoreClasses.as   |   1 +
 .../royale/core/{IIcon.as => ITextButton.as}       |  21 +++-
 .../Jewel/src/main/resources/jewel-manifest.xml    |   3 +-
 .../main/royale/org/apache/royale/jewel/Button.as  |  46 ++++++-
 .../royale/org/apache/royale/jewel/CheckBox.as     |  29 +++--
 .../royale/org/apache/royale/jewel/IconButton.as   |  23 +---
 .../royale/org/apache/royale/jewel/RadioButton.as  |  29 +++--
 .../royale/org/apache/royale/jewel/ToggleButton.as |   2 +-
 .../beads/controls/{ => button}/InputButtonSize.as |   2 +-
 .../controls/button/ResponsiveLabelVisibility.as   | 102 ++++++++++++++++
 .../royale/jewel/beads/layouts/GridCellLayout.as   | 132 +++++++--------------
 .../jewel/beads/layouts/ResponsiveVisibility.as    |  77 ++++--------
 .../JewelTheme/src/main/resources/defaults.css     |  12 +-
 .../src/main/sass/components-primary/_button.sass  |  12 +-
 14 files changed, 291 insertions(+), 200 deletions(-)
 copy frameworks/projects/Core/src/main/royale/org/apache/royale/core/{IIcon.as => ITextButton.as} (69%)
 rename frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/{ => button}/InputButtonSize.as (99%)
 create mode 100644 frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/button/ResponsiveLabelVisibility.as


[royale-asjs] 05/08: jewel-button: add ITextButton interface to buttons with text label (included checkbox and radiobutton) and make text label use a span to make it more usable

Posted by ca...@apache.org.
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

commit cb8dde4bf601f3d6c2c978061b48450a4f7292dd
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 15 18:10:46 2020 +0200

    jewel-button: add ITextButton interface to buttons with text label (included checkbox and radiobutton) and make text label use a span to make it more usable
---
 .../main/royale/org/apache/royale/jewel/Button.as  | 46 +++++++++++++++++++---
 .../royale/org/apache/royale/jewel/CheckBox.as     | 29 ++++++++++----
 .../royale/org/apache/royale/jewel/IconButton.as   | 23 +----------
 .../royale/org/apache/royale/jewel/RadioButton.as  | 29 ++++++++++----
 .../royale/org/apache/royale/jewel/ToggleButton.as |  2 +-
 5 files changed, 86 insertions(+), 43 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Button.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Button.as
index 504fedf..21db9ed 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Button.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Button.as
@@ -28,8 +28,10 @@ package org.apache.royale.jewel
     //but IE11 will break if the following import is removed:
     //@carlosrovira: Probably the above issue is due to the need to be in COMPILE::JS, so IDEs organizing imports don't remove this one
     import org.apache.royale.events.Event;
+    import org.apache.royale.core.WrappedHTMLElement;
     }
     import org.apache.royale.jewel.supportClasses.button.SimpleButton;
+    import org.apache.royale.core.ITextButton;
 
     [DefaultProperty("text")]
 
@@ -46,7 +48,7 @@ package org.apache.royale.jewel
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.9.4
      */
-    public class Button extends SimpleButton
+    public class Button extends SimpleButton implements ITextButton
     {
 		/**
 		 *  Constructor.
@@ -80,7 +82,7 @@ package org.apache.royale.jewel
 			}
 			COMPILE::JS
 			{
-			return (element as HTMLButtonElement).textContent;
+			return spanLabel.textContent;
 			}
 		}
 		/**
@@ -94,7 +96,7 @@ package org.apache.royale.jewel
 			}
 			COMPILE::JS
 			{
-			(element as HTMLButtonElement).textContent = value;
+			spanLabel.textContent = value;
 			dispatchEvent(new Event('textChange'));
 			}
 		}
@@ -119,7 +121,7 @@ package org.apache.royale.jewel
 			}
 			COMPILE::JS
 			{
-			return (element as HTMLButtonElement).innerHTML;
+			return spanLabel.innerHTML;
 			}
 		}
 		/**
@@ -133,9 +135,43 @@ package org.apache.royale.jewel
 			}
 			COMPILE::JS
 			{
-			(element as HTMLButtonElement).innerHTML = value;
+			spanLabel.innerHTML = value;
 			dispatchEvent(new Event('htmlChange'));
 			}
 		}
+
+		COMPILE::JS
+		private var _spanLabel:HTMLSpanElement;
+		/**
+         *  the span for the label text
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
+         */
+		COMPILE::JS
+		public function get spanLabel():HTMLSpanElement {
+			return _spanLabel;
+		}
+		COMPILE::JS
+		public function set spanLabel(value:HTMLSpanElement):void {
+			_spanLabel = value;
+		}
+
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
+         */
+		COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+			super.createElement();
+            
+			spanLabel = document.createElement('span') as HTMLSpanElement;
+			spanLabel.textContent = text;
+			element.appendChild(spanLabel);
+
+            return element;
+        }
 	}
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
index f8ca27b..112f565 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
@@ -31,6 +31,7 @@ package org.apache.royale.jewel
     import org.apache.royale.html.util.addElementToWrapper;
     }
 
+    import org.apache.royale.core.ITextButton;
     import org.apache.royale.jewel.supportClasses.IInputButton;
     import org.apache.royale.jewel.supportClasses.button.SelectableButtonBase;
     
@@ -49,7 +50,7 @@ package org.apache.royale.jewel
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.9.4
      */
-    public class CheckBox extends SelectableButtonBase implements IInputButton
+    public class CheckBox extends SelectableButtonBase implements IInputButton, ITextButton
     {
         /**
          *  Constructor.
@@ -141,7 +142,7 @@ package org.apache.royale.jewel
             if(!textNode)
             {
                 textNode = document.createTextNode('') as Text;
-                checkbox.appendChild(textNode);
+                spanLabel.appendChild(textNode);
             }
             
             textNode.nodeValue = value;
@@ -202,11 +203,23 @@ package org.apache.royale.jewel
         }
 
         COMPILE::JS
-        /**
-         * a HTMLSpanElement decorator for this component
-         * added to the positioner.
+		private var _spanLabel:HTMLSpanElement;
+		/**
+         *  the span for the label text
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
          */
-        protected var checkbox:HTMLSpanElement;
+		COMPILE::JS
+		public function get spanLabel():HTMLSpanElement {
+			return _spanLabel;
+		}
+		COMPILE::JS
+		public function set spanLabel(value:HTMLSpanElement):void {
+			_spanLabel = value;
+		}
         
         COMPILE::JS
         /**
@@ -225,7 +238,7 @@ package org.apache.royale.jewel
         {
             input = addElementToWrapper(this,'input') as HTMLInputElement;
             input.type = 'checkbox';
-            checkbox = document.createElement('span') as HTMLSpanElement;
+            spanLabel = document.createElement('span') as HTMLSpanElement;
             positioner = document.createElement('label') as WrappedHTMLElement;   
             return element;
         }
@@ -251,7 +264,7 @@ package org.apache.royale.jewel
 			_positioner = value;
             _positioner.royale_wrapper = this;
 			_positioner.appendChild(element);
-            _positioner.appendChild(checkbox);
+            _positioner.appendChild(spanLabel);
 		}
     }
 }
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/IconButton.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/IconButton.as
index 1d72e54..e8427eb 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/IconButton.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/IconButton.as
@@ -54,9 +54,6 @@ package org.apache.royale.jewel
 		}
 
         COMPILE::JS
-        protected var textNode:Text;
-
-        COMPILE::JS
         private var _text:String = "";
 
         [Bindable("textChange")]
@@ -79,10 +76,10 @@ package org.apache.royale.jewel
         COMPILE::JS
 		override public function set text(value:String):void
 		{
-            if (textNode)
+            if (spanLabel)
             {
                 _text = value;
-                textNode.nodeValue = value;
+                spanLabel.textContent = value;
                 dispatchEvent(new Event('textChange'));
             }
 		}
@@ -150,21 +147,5 @@ package org.apache.royale.jewel
             addElementAt(_icon, rightPosition? numElements : 0);
             }
         }
-
-        /**
-		 * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
-		 * @royaleignorecoercion org.apache.royale.html.util.addElementToWrapper
-         */
-        COMPILE::JS
-        override protected function createElement():WrappedHTMLElement
-        {
-			addElementToWrapper(this, 'button');
-            element.setAttribute('type', 'button');
-            
-            textNode = document.createTextNode(_text) as Text;
-            element.appendChild(textNode);
-
-            return element;
-        }
 	}
 }
\ No newline at end of file
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as
index edda47c..a229e79 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as
@@ -32,6 +32,7 @@ package org.apache.royale.jewel
     import org.apache.royale.html.util.addElementToWrapper;
     }
 
+    import org.apache.royale.core.ITextButton;
     import org.apache.royale.events.MouseEvent;
     import org.apache.royale.jewel.supportClasses.IInputButton;
     import org.apache.royale.jewel.supportClasses.button.SelectableButtonBase;
@@ -50,7 +51,7 @@ package org.apache.royale.jewel
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.9.4
      */
-    public class RadioButton extends SelectableButtonBase implements IInputButton
+    public class RadioButton extends SelectableButtonBase implements IInputButton, ITextButton
     {
         /**
          *  Constructor.
@@ -309,11 +310,23 @@ package org.apache.royale.jewel
         }
         
         COMPILE::JS
-        /**
-         * a HTMLSpanElement decorator for this component
-         * added to the positioner.
+		private var _spanLabel:HTMLSpanElement;
+		/**
+         *  the span for the label text
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
          */
-        protected var radio:HTMLSpanElement;
+		COMPILE::JS
+		public function get spanLabel():HTMLSpanElement {
+			return _spanLabel;
+		}
+		COMPILE::JS
+		public function set spanLabel(value:HTMLSpanElement):void {
+			_spanLabel = value;
+		}
 
         COMPILE::JS
         /**
@@ -336,8 +349,8 @@ package org.apache.royale.jewel
             icon.value = String(value);
             
             textNode = document.createTextNode('') as Text;
-            radio = document.createElement('span') as HTMLSpanElement;
-            radio.appendChild(textNode);
+            spanLabel = document.createElement('span') as HTMLSpanElement;
+            spanLabel.appendChild(textNode);
             
             positioner = document.createElement('label') as WrappedHTMLElement;
             
@@ -365,7 +378,7 @@ package org.apache.royale.jewel
 			_positioner = value;
             _positioner.royale_wrapper = this;
 			_positioner.appendChild(element);
-            _positioner.appendChild(radio);
+            _positioner.appendChild(spanLabel);
 		}
 
         /**
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
index 929727f..df3009c 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/ToggleButton.as
@@ -211,7 +211,7 @@ package org.apache.royale.jewel
 
             COMPILE::JS
 			{
-                textNode.nodeValue = _selected ? selectedText : text;
+                spanLabel.textContent = _selected ? selectedText : text;
 			}
         }
 


[royale-asjs] 04/08: jewel-responsivesize: simplify code and make it extendable

Posted by ca...@apache.org.
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

commit 072c7e01e67a0d9dc7e46cec434c5b205515cc39
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 15 18:08:35 2020 +0200

    jewel-responsivesize: simplify code and make it extendable
---
 .../jewel/beads/layouts/ResponsiveVisibility.as    | 77 +++++++---------------
 1 file changed, 25 insertions(+), 52 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ResponsiveVisibility.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ResponsiveVisibility.as
index 1a509e6..9db7973 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ResponsiveVisibility.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/ResponsiveVisibility.as
@@ -20,7 +20,7 @@ package org.apache.royale.jewel.beads.layouts
 {	
 	import org.apache.royale.core.IBead;
 	import org.apache.royale.core.IStrand;
-	import org.apache.royale.core.StyledUIBase;
+	import org.apache.royale.utils.IClassSelectorListSupport;
 	
 	/**
 	 *  The ResponsiveVisibility bead class is a specialty bead that 
@@ -162,7 +162,7 @@ package org.apache.royale.jewel.beads.layouts
 			}
 		}
 
-		private var _strand:IStrand;
+		protected var _strand:IStrand;
 		
 		/**
 		 *  @copy org.apache.royale.core.IBead#strand
@@ -180,69 +180,42 @@ package org.apache.royale.jewel.beads.layouts
 			showOrHideHost();
 		}
 
-		private function showOrHideHost():void
+		protected function showOrHideHost():void
 		{
-			var host:StyledUIBase = _strand as StyledUIBase;
+			var host:IClassSelectorListSupport = _strand as IClassSelectorListSupport;
 			if (host)
             {
-				if(_phoneVisible != null)
+				if(phoneVisible != null)
 				{
-					if(_phoneVisible)
-					{
-						if (host.containsClass("hidden-phone"))
-							host.removeClass("hidden-phone");
-						host.addClass("visible-phone");
-					} else
-					{
-						if (host.containsClass("visible-phone"))
-							host.removeClass("visible-phone");
-						host.addClass("hidden-phone");
-					}
+					if(phoneVisible)
+						host.replaceClass("hidden-phone", "visible-phone");
+					else
+						host.replaceClass("visible-phone", "hidden-phone");
 				}
 
-				if(_tabletVisible != null)
+				if(tabletVisible != null)
 				{
-					if(_tabletVisible)
-					{
-						if (host.containsClass("hidden-tablet"))
-							host.removeClass("hidden-tablet");
-						host.addClass("visible-tablet");
-					} else
-					{
-						if (host.containsClass("visible-tablet"))
-							host.removeClass("visible-tablet");
-						host.addClass("hidden-tablet");
-					}
+					if(tabletVisible)
+						host.replaceClass("hidden-tablet", "visible-tablet");
+					else
+						host.replaceClass("visible-tablet", "hidden-tablet");
+
 				}
 
-				if(_desktopVisible != null)
+				if(desktopVisible != null)
 				{
-					if(_desktopVisible)
-					{
-						if (host.containsClass("hidden-desktop"))
-							host.removeClass("hidden-desktop");
-						host.addClass("visible-desktop");
-					} else
-					{
-						if (host.containsClass("visible-desktop"))
-							host.removeClass("visible-desktop");
-						host.addClass("hidden-desktop");
-					}
+					if(desktopVisible)
+						host.replaceClass("hidden-desktop", "visible-desktop");
+					else
+						host.replaceClass("visible-desktop", "hidden-desktop");
 				}
 
-				if(_wideScreenVisible != null)
+				if(wideScreenVisible != null)
 				{
-					if(_wideScreenVisible)
-					{
-						if (host.containsClass("hidden-widescreen"))
-							host.removeClass("hidden-widescreen");
-						host.addClass("visible-widescreen");
-					} else
-					{
-						if (host.containsClass("visible-widescreen"))
-							host.removeClass("visible-widescreen");
-						host.addClass("hidden-widescreen");
-					}
+					if(wideScreenVisible)
+						host.replaceClass("hidden-widescreen", "visible-widescreen");
+					else
+						host.replaceClass("visible-widescreen", "hidden-widescreen");
 				}
             }
 		}


[royale-asjs] 02/08: core-itextbutton interface

Posted by ca...@apache.org.
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

commit eaaddbb672cadbf07d2e14c9266a74211ab52045
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 15 18:06:04 2020 +0200

    core-itextbutton interface
---
 .../projects/Core/src/main/royale/CoreClasses.as   |  1 +
 .../royale/org/apache/royale/core/ITextButton.as   | 55 ++++++++++++++++++++++
 2 files changed, 56 insertions(+)

diff --git a/frameworks/projects/Core/src/main/royale/CoreClasses.as b/frameworks/projects/Core/src/main/royale/CoreClasses.as
index b16ddc0..6cf73c5 100644
--- a/frameworks/projects/Core/src/main/royale/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/royale/CoreClasses.as
@@ -36,6 +36,7 @@ internal class CoreClasses
 	import org.apache.royale.core.ApplicationBase; ApplicationBase;
 	import org.apache.royale.core.IList; IList;
 	import org.apache.royale.core.IIcon; IIcon;
+	import org.apache.royale.core.ITextButton; ITextButton;
 	import org.apache.royale.core.IIconSupport; IIconSupport;
 	import org.apache.royale.core.ITextInput; ITextInput;
 	import org.apache.royale.html.beads.IListView; IListView;
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ITextButton.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ITextButton.as
new file mode 100644
index 0000000..29f65bf
--- /dev/null
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ITextButton.as
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.core
+{
+    /**
+     *  ITextButton interface is implemented by button classes with text property like Button, CheckBox and RadioButton
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.10.0
+     */
+    public interface ITextButton extends IUIBase
+    {
+        /**
+         *  The text of the icon
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
+         */
+		function get text():String;
+        function set text(value:String):void;
+
+        /**
+         *  the span for the label text
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.10.0
+         */
+		COMPILE::JS
+        function get spanLabel():HTMLSpanElement;
+		COMPILE::JS
+		function set spanLabel(value:HTMLSpanElement):void;
+    }
+}


[royale-asjs] 03/08: jewel-inputbuttonzise: move toitsown button package

Posted by ca...@apache.org.
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

commit 2023bcd082493f6a1b5b25c2b367ae4d7fbbfdfc
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 15 18:08:10 2020 +0200

    jewel-inputbuttonzise: move toitsown button package
---
 frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml         | 2 +-
 .../apache/royale/jewel/beads/controls/{ => button}/InputButtonSize.as  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 13fe4cc..34acdaa 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -169,7 +169,7 @@
 
     <component id="ResponsiveDrawer" class="org.apache.royale.jewel.beads.controls.drawer.ResponsiveDrawer"/>
     
-    <component id="InputButtonSize" class="org.apache.royale.jewel.beads.controls.InputButtonSize"/>
+    <component id="InputButtonSize" class="org.apache.royale.jewel.beads.controls.button.InputButtonSize"/>
 
     <component id="MultiLine" class="org.apache.royale.jewel.beads.controls.MultiLine"/>
     <component id="NavigationActionNotifier" class="org.apache.royale.jewel.beads.controls.NavigationActionNotifier"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/InputButtonSize.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/button/InputButtonSize.as
similarity index 99%
rename from frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/InputButtonSize.as
rename to frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/button/InputButtonSize.as
index 3186e87..23ffede 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/InputButtonSize.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/button/InputButtonSize.as
@@ -16,7 +16,7 @@
 //  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
-package org.apache.royale.jewel.beads.controls
+package org.apache.royale.jewel.beads.controls.button
 {
 	import org.apache.royale.core.IBead;
 	import org.apache.royale.core.IStrand;


[royale-asjs] 07/08: jewel-button: padding between text and icon is now applied to text instead to icon

Posted by ca...@apache.org.
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

commit 3114904aff61dba5f276a89894744731b39d3d5c
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 15 19:22:36 2020 +0200

    jewel-button: padding between text and icon is now applied to text instead to icon
---
 frameworks/themes/JewelTheme/src/main/resources/defaults.css | 12 ++++++------
 .../JewelTheme/src/main/sass/components-primary/_button.sass | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/frameworks/themes/JewelTheme/src/main/resources/defaults.css b/frameworks/themes/JewelTheme/src/main/resources/defaults.css
index a650c2e..ab15272 100644
--- a/frameworks/themes/JewelTheme/src/main/resources/defaults.css
+++ b/frameworks/themes/JewelTheme/src/main/resources/defaults.css
@@ -175,18 +175,18 @@ hr {
 .jewel.button.icon {
   padding: 0.429em 0.87em;
 }
-.jewel.button.icon i {
+.jewel.button.icon span {
   margin-left: 0px;
   margin-right: 0px;
 }
-.jewel.button.left-space i {
-  margin-left: 0px;
-  margin-right: 8px;
-}
-.jewel.button.right-space i {
+.jewel.button.left-space span {
   margin-left: 8px;
   margin-right: 0px;
 }
+.jewel.button.right-space span {
+  margin-left: 0px;
+  margin-right: 8px;
+}
 
 .jewel.button.primary {
   background: linear-gradient(#54b7f3, #24a3ef);
diff --git a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_button.sass b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_button.sass
index b6ec063..4da9f70 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_button.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_button.sass
@@ -49,18 +49,18 @@ $button-border-radius: $border-radius
 	&.icon
 		padding: $icon-button-padding
 
-		i
+		span
 			margin-left: 0px
 			margin-right: 0px
 
 	&.left-space
-		i
-			margin-left: 0px
-			margin-right: 8px
-	&.right-space
-		i
+		span
 			margin-left: 8px
 			margin-right: 0px
+	&.right-space
+		span
+			margin-left: 0px
+			margin-right: 8px
 
 .jewel.button.primary
 	+button-theme($primary-color, $font-theme-color)


[royale-asjs] 06/08: jewel-responsive-label-visibiility: add resoposive visibility for text labelsin buttons

Posted by ca...@apache.org.
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

commit 509b4475fbab8223b827feb11f1c4ddab64a8df8
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 15 18:11:38 2020 +0200

    jewel-responsive-label-visibiility: add resoposive visibility for text labelsin buttons
---
 .../Jewel/src/main/resources/jewel-manifest.xml    |   1 +
 .../controls/button/ResponsiveLabelVisibility.as   | 102 +++++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 34acdaa..fecfbc0 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -170,6 +170,7 @@
     <component id="ResponsiveDrawer" class="org.apache.royale.jewel.beads.controls.drawer.ResponsiveDrawer"/>
     
     <component id="InputButtonSize" class="org.apache.royale.jewel.beads.controls.button.InputButtonSize"/>
+    <component id="ResponsiveLabelVisibility" class="org.apache.royale.jewel.beads.controls.button.ResponsiveLabelVisibility"/>
 
     <component id="MultiLine" class="org.apache.royale.jewel.beads.controls.MultiLine"/>
     <component id="NavigationActionNotifier" class="org.apache.royale.jewel.beads.controls.NavigationActionNotifier"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/button/ResponsiveLabelVisibility.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/button/ResponsiveLabelVisibility.as
new file mode 100644
index 0000000..bc805ab
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/button/ResponsiveLabelVisibility.as
@@ -0,0 +1,102 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.beads.controls.button
+{	
+	import org.apache.royale.core.ITextButton;
+	import org.apache.royale.jewel.beads.layouts.ResponsiveVisibility;
+	import org.apache.royale.jewel.Button;
+	
+	/**
+	 *  The ResponsiveLabelVisibility bead class is a specialty bead that 
+	 *  can be used to show or hide the label text of a Button depending on responsive
+	 *  rules.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.10.0
+	 */
+	public class ResponsiveLabelVisibility extends ResponsiveVisibility
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.10.0
+		 */
+		public function ResponsiveLabelVisibility()
+		{
+		}
+		
+		override protected function showOrHideHost():void
+		{
+			COMPILE::JS
+			{
+			// var button:ITextButton = _strand as ITextButton;
+			var button:Button = _strand as Button;
+			if (button)
+            {
+				var spanLabel:HTMLSpanElement = button.spanLabel;
+				spanLabel.classList.remove("visible-phone");
+				spanLabel.classList.remove("hidden-phone");
+				spanLabel.classList.remove("visible-tablet");
+				spanLabel.classList.remove("hidden-tablet");
+				spanLabel.classList.remove("visible-desktop");
+				spanLabel.classList.remove("hidden-desktop");
+				spanLabel.classList.remove("visible-widescreen");
+				spanLabel.classList.remove("hidden-widescreen");
+
+				if(phoneVisible != null)
+				{
+					if(phoneVisible)
+						spanLabel.classList.add("visible-phone");
+					else
+						spanLabel.classList.add("hidden-phone");
+				}
+
+				if(tabletVisible != null)
+				{
+					if(tabletVisible)
+						spanLabel.classList.add("visible-tablet");
+					else
+						spanLabel.classList.add("hidden-tablet");
+				}
+				
+				if(desktopVisible != null)
+				{
+					if(desktopVisible)
+						spanLabel.classList.add("visible-desktop");
+					else
+						spanLabel.classList.add("hidden-desktop");
+				}
+
+				if(wideScreenVisible != null)
+				{
+					if(wideScreenVisible)
+						spanLabel.classList.add("visible-widescreen");
+					else
+						spanLabel.classList.add("hidden-widescreen");
+				}
+			}
+        	}
+		}
+	}
+}


[royale-asjs] 01/08: jewel-grid: simplify code

Posted by ca...@apache.org.
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

commit 8e9dca5caf1fd9f1b7d8c18ce38d3fccd616f7e4
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 15 18:05:13 2020 +0200

    jewel-grid: simplify code
---
 .../royale/jewel/beads/layouts/GridCellLayout.as   | 132 +++++++--------------
 1 file changed, 45 insertions(+), 87 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridCellLayout.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridCellLayout.as
index 96bd835..ef2b7f7 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridCellLayout.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/GridCellLayout.as
@@ -74,13 +74,10 @@ package org.apache.royale.jewel.beads.layouts
 		{
 			super.beadsAddedHandler();
 
-			COMPILE::JS
-			{
-				setFractionForScreen(WIDESCREEN, _wideScreenNumerator, _wideScreenDenominator);
-				setFractionForScreen(DESKTOP, _desktopNumerator, _desktopDenominator);
-				setFractionForScreen(TABLET, _tabletNumerator, _tabletDenominator);
-				setFractionForScreen(PHONE, _phoneNumerator, _phoneDenominator);
-			}
+			setFractionForScreen(WIDESCREEN, _wideScreenNumerator, _wideScreenDenominator);
+			setFractionForScreen(DESKTOP, _desktopNumerator, _desktopDenominator);
+			setFractionForScreen(TABLET, _tabletNumerator, _tabletDenominator);
+			setFractionForScreen(PHONE, _phoneNumerator, _phoneDenominator);
 		}
 
 		private var _wideScreenNumerator:Number;
@@ -103,11 +100,8 @@ package org.apache.royale.jewel.beads.layouts
         {
 			if (_wideScreenNumerator != value)
             {
-                COMPILE::JS
-                {
-					if(hostComponent)
-						setFractionForScreen(WIDESCREEN, value, _wideScreenDenominator);
-				}
+				if(hostComponent)
+					setFractionForScreen(WIDESCREEN, value, _wideScreenDenominator);
 				_wideScreenNumerator = value;
 			}
 		}
@@ -132,11 +126,8 @@ package org.apache.royale.jewel.beads.layouts
         {
 			if (_wideScreenDenominator != value)
             {
-                COMPILE::JS
-                {
-					if(hostComponent)
-						setFractionForScreen(WIDESCREEN, _wideScreenNumerator, value);
-				}
+				if(hostComponent)
+					setFractionForScreen(WIDESCREEN, _wideScreenNumerator, value);
 				_wideScreenDenominator = value;
 			}
 		}
@@ -161,11 +152,8 @@ package org.apache.royale.jewel.beads.layouts
         {
 			if (_desktopNumerator != value)
             {
-                COMPILE::JS
-                {
-					if(hostComponent)
-						setFractionForScreen(DESKTOP, value, _desktopDenominator);
-				}
+				if(hostComponent)
+					setFractionForScreen(DESKTOP, value, _desktopDenominator);
 				_desktopNumerator = value;
 			}
 		}
@@ -190,11 +178,8 @@ package org.apache.royale.jewel.beads.layouts
         {
 			if (_desktopDenominator != value)
             {
-                COMPILE::JS
-                {
-					if(hostComponent)
-						setFractionForScreen(DESKTOP, _desktopNumerator, value);
-				}
+				if(hostComponent)
+					setFractionForScreen(DESKTOP, _desktopNumerator, value);
 				_desktopDenominator = value;
 			}
 		}
@@ -219,11 +204,8 @@ package org.apache.royale.jewel.beads.layouts
         {
 			if (_tabletNumerator != value)
             {
-                COMPILE::JS
-                {
-					if(hostComponent)
-						setFractionForScreen(TABLET, value, _tabletDenominator);
-				}
+				if(hostComponent)
+					setFractionForScreen(TABLET, value, _tabletDenominator);
 				_tabletNumerator = value;
 			}
 		}
@@ -248,11 +230,8 @@ package org.apache.royale.jewel.beads.layouts
         {
 			if (_tabletDenominator != value)
             {
-                COMPILE::JS
-                {
-					if(hostComponent)
-						setFractionForScreen(TABLET, _tabletNumerator, value);
-				}
+				if(hostComponent)
+					setFractionForScreen(TABLET, _tabletNumerator, value);
 				_tabletDenominator = value;
 			}
 		}
@@ -277,11 +256,8 @@ package org.apache.royale.jewel.beads.layouts
         {
 			if (_phoneNumerator != value)
             {
-                COMPILE::JS
-                {
-					if(hostComponent)
-						setFractionForScreen(PHONE, value, _phoneDenominator);
-				}
+				if(hostComponent)
+					setFractionForScreen(PHONE, value, _phoneDenominator);
 				_phoneNumerator = value;
 			}
 		}
@@ -306,16 +282,12 @@ package org.apache.royale.jewel.beads.layouts
         {
 			if (_phoneDenominator != value)
             {
-                COMPILE::JS
-                {
-					if(hostComponent)
-						setFractionForScreen(PHONE, _phoneNumerator, value);
-				}
+				if(hostComponent)
+					setFractionForScreen(PHONE, _phoneNumerator, value);
 				_phoneDenominator = value;
 			}
 		}
 
-		COMPILE::JS
 		private function setFractionForScreen(screen:String, num:Number, den:Number):void
 		{
 			if(num && den)
@@ -350,15 +322,12 @@ package org.apache.royale.jewel.beads.layouts
             {
 				_phoneVisible = value;
 
-                COMPILE::JS
-                {
-					if(hostComponent)
-					{
-						if(_phoneVisible)
-							hostComponent.replaceClass("hidden-phone", "visible-phone");
-						else
-							hostComponent.replaceClass("visible-phone", "hidden-phone");
-					}
+				if(hostComponent)
+				{
+					if(_phoneVisible)
+						hostComponent.replaceClass("hidden-phone", "visible-phone");
+					else
+						hostComponent.replaceClass("visible-phone", "hidden-phone");
 				}
 			}
 		}
@@ -384,15 +353,12 @@ package org.apache.royale.jewel.beads.layouts
             {
 				_tabletVisible = value;
 
-                COMPILE::JS
-                {
-					if(hostComponent)
-					{
-						if(_tabletVisible)
-							hostComponent.replaceClass("hidden-tablet", "visible-tablet");
-						else
-							hostComponent.replaceClass("visible-tablet", "hidden-tablet");
-					}
+				if(hostComponent)
+				{
+					if(_tabletVisible)
+						hostComponent.replaceClass("hidden-tablet", "visible-tablet");
+					else
+						hostComponent.replaceClass("visible-tablet", "hidden-tablet");
 				}
 			}
 		}
@@ -418,15 +384,12 @@ package org.apache.royale.jewel.beads.layouts
             {
 				_desktopVisible = value;
                 
-				COMPILE::JS
-                {
-					if(hostComponent)
-					{
-						if(_desktopVisible)
-							hostComponent.replaceClass("hidden-desktop", "visible-desktop");
-						else
-							hostComponent.replaceClass("visible-desktop", "hidden-desktop");
-					}
+				if(hostComponent)
+				{
+					if(_desktopVisible)
+						hostComponent.replaceClass("hidden-desktop", "visible-desktop");
+					else
+						hostComponent.replaceClass("visible-desktop", "hidden-desktop");
 				}
 			}
 		}
@@ -452,15 +415,12 @@ package org.apache.royale.jewel.beads.layouts
             {
 				_wideScreenVisible = value;
 
-                COMPILE::JS
-                {
-					if(hostComponent)
-					{
-						if(_wideScreenVisible)
-							hostComponent.replaceClass("hidden-widescreen", "visible-widescreen");
-						else
-							hostComponent.replaceClass("visible-widescreen", "hidden-widescreen");
-					}
+				if(hostComponent)
+				{
+					if(_wideScreenVisible)
+						hostComponent.replaceClass("hidden-widescreen", "visible-widescreen");
+					else
+						hostComponent.replaceClass("visible-widescreen", "hidden-widescreen");
 				}
 			}
 		}
@@ -585,9 +545,7 @@ package org.apache.royale.jewel.beads.layouts
 
             COMPILE::JS
             {
-				super.layout();
-				
-                return true;
+			return true;
             }
 		}
 	}


[royale-asjs] 08/08: Merge branch 'feature/responsive-button-labels' into develop

Posted by ca...@apache.org.
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

commit e52c07a633ab80324d824f10aa99b33c95834118
Merge: f4524fb 3114904
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Jun 15 19:23:19 2020 +0200

    Merge branch 'feature/responsive-button-labels' into develop
    
    * feature/responsive-button-labels:
      jewel-button: padding between text and icon is now applied to text instead to icon
      jewel-responsive-label-visibiility: add resoposive visibility for text labelsin buttons
      jewel-button: add ITextButton interface to buttons with text label (included checkbox and radiobutton) and make text label use a span to make it more usable
      jewel-responsivesize: simplify code and make it extendable
      jewel-inputbuttonzise: move toitsown button package
      core-itextbutton interface
      jewel-grid: simplify code

 .../projects/Core/src/main/royale/CoreClasses.as   |   1 +
 .../royale/org/apache/royale/core/ITextButton.as   |  55 +++++++++
 .../Jewel/src/main/resources/jewel-manifest.xml    |   3 +-
 .../main/royale/org/apache/royale/jewel/Button.as  |  46 ++++++-
 .../royale/org/apache/royale/jewel/CheckBox.as     |  29 +++--
 .../royale/org/apache/royale/jewel/IconButton.as   |  23 +---
 .../royale/org/apache/royale/jewel/RadioButton.as  |  29 +++--
 .../royale/org/apache/royale/jewel/ToggleButton.as |   2 +-
 .../beads/controls/{ => button}/InputButtonSize.as |   2 +-
 .../controls/button/ResponsiveLabelVisibility.as   | 102 ++++++++++++++++
 .../royale/jewel/beads/layouts/GridCellLayout.as   | 132 +++++++--------------
 .../jewel/beads/layouts/ResponsiveVisibility.as    |  77 ++++--------
 .../JewelTheme/src/main/resources/defaults.css     |  12 +-
 .../src/main/sass/components-primary/_button.sass  |  12 +-
 14 files changed, 329 insertions(+), 196 deletions(-)