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 7acc17cabfac130621276162121f71ae06e62a5e
Author: Carlos Rovira <[email protected]>
AuthorDate: Wed Jun 3 09:26:07 2020 +0200

    tilelayout: add bindable to properties
---
 .../royale/jewel/beads/layouts/TileLayout.as       | 54 ++++++++++++----------
 1 file changed, 30 insertions(+), 24 deletions(-)

diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as
index 2deb048..5448ceb 100644
--- 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/layouts/TileLayout.as
@@ -92,7 +92,7 @@ package org.apache.royale.jewel.beads.layouts
                 *  @playerversion AIR 2.6
                 *  @productversion Royale 0.9.4
                 */
-               [Bindable]
+               [Bindable("columnCountChanged")]
                public function get columnCount():Number
                {
                        return _columnCount;
@@ -114,7 +114,7 @@ package org.apache.royale.jewel.beads.layouts
                 *  @playerversion AIR 2.6
                 *  @productversion Royale 0.9.4
                 */
-               [Bindable]
+               [Bindable("columnWidthChanged")]
                public function get columnWidth():Number
                {
                        return _columnWidth;
@@ -134,7 +134,7 @@ package org.apache.royale.jewel.beads.layouts
                 *  @playerversion AIR 2.6
                 *  @productversion Royale 0.9.8
                 */
-               [Bindable]
+               [Bindable("rowCountChanged")]
                public function get rowCount():Number
                {
                        return _rowCount;
@@ -156,7 +156,7 @@ package org.apache.royale.jewel.beads.layouts
                 *  @playerversion AIR 2.6
                 *  @productversion Royale 0.9.4
                 */
-               [Bindable]
+               [Bindable("rowHeightChanged")]
                public function get rowHeight():Number
                {
                        return _rowHeight;
@@ -170,57 +170,57 @@ package org.apache.royale.jewel.beads.layouts
                /**
                 *  @private
                 */
-               private var verticalGapInitialized:Boolean;
-               public static const VERTICAL_GAP_STYLE:String = "verticalGap"
-               private var _verticalGap:Number = 0;
+               private var horizontalGapInitialized:Boolean;
+               public static const HORIZONTAL_GAP_STYLE:String = 
"horizontalGap"
+               private var _horizontalGap:Number = 0;
                /**
-                *  The verticalGap between items.
+                *  The horizontalGap between items.
                 *
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
                 *  @productversion Royale 0.9.4
                 */
-               [Bindable]
-               public function get verticalGap():Number
+               [Bindable("horizontalGapChanged")]
+               public function get horizontalGap():Number
                {
-                       return _verticalGap;
+                       return _horizontalGap;
                }
                /**
                 *  @private
                 */
-               public function set verticalGap(value:Number):void
+               public function set horizontalGap(value:Number):void
                {
-                       _verticalGap = value;
-                       verticalGapInitialized = true;
+                       _horizontalGap = value;
+                       horizontalGapInitialized = true;
                }
 
                /**
                 *  @private
                 */
-               private var horizontalGapInitialized:Boolean;
-               public static const HORIZONTAL_GAP_STYLE:String = 
"horizontalGap"
-               private var _horizontalGap:Number = 0;
+               private var verticalGapInitialized:Boolean;
+               public static const VERTICAL_GAP_STYLE:String = "verticalGap"
+               private var _verticalGap:Number = 0;
                /**
-                *  The horizontalGap between items.
+                *  The verticalGap between items.
                 *
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
                 *  @productversion Royale 0.9.4
                 */
-               [Bindable]
-               public function get horizontalGap():Number
+               [Bindable("verticalGapChanged")]
+               public function get verticalGap():Number
                {
-                       return _horizontalGap;
+                       return _verticalGap;
                }
                /**
                 *  @private
                 */
-               public function set horizontalGap(value:Number):void
+               public function set verticalGap(value:Number):void
                {
-                       _horizontalGap = value;
-                       horizontalGapInitialized = true;
+                       _verticalGap = value;
+                       verticalGapInitialized = true;
                }
 
                /**
@@ -377,6 +377,9 @@ package org.apache.royale.jewel.beads.layouts
                                        {
                                                useWidth = 
Math.floor((adjustedHostWidth + horizontalGap)/ columnCount);
                                                trace("  -- useWidth", 
useWidth);
+                                       } else {
+                                               // we have tile width so 
calculate columnCount
+                                               _columnCount = 
Math.floor((adjustedHostWidth + horizontalGap)/ useWidth);
                                        }
                                        
                                        if (needHeight)
@@ -387,6 +390,9 @@ package org.apache.royale.jewel.beads.layouts
                                                if 
(host.isHeightSizedToContent()) useHeight = 30; // default height
                                                else useHeight = 
Math.floor((adjustedHostHeight + verticalGap) / numRows);
                                                trace("  -- useHeight", 
useHeight);
+                                       } else {
+                                               // we have tile height so 
calculate rowCount
+                                               _rowCount = 
Math.floor((adjustedHostHeight + verticalGap)/ useHeight);
                                        }
                                }
                                

Reply via email to