Fixes a bug on FlatSpark Button and ButtonIcon skins when borderRadius is 
changed

Removed Up, Over, Down and Disabled states in favor of just using color.[state]


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/60488ec5
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/60488ec5
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/60488ec5

Branch: refs/heads/master
Commit: 60488ec5ddb6b585e86f4b24566060071817b5dc
Parents: cceda7b
Author: Mahmoud Ali <[email protected]>
Authored: Wed Jan 7 05:55:16 2015 -0300
Committer: Erik de Bruin <[email protected]>
Committed: Wed Jan 7 11:33:31 2015 +0100

----------------------------------------------------------------------
 .../src/flatspark/skins/ButtonIconSkin.mxml     | 31 ++++--------------
 .../src/flatspark/skins/ButtonSkin.mxml         | 33 +++++---------------
 2 files changed, 13 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/60488ec5/frameworks/projects/flatspark/src/flatspark/skins/ButtonIconSkin.mxml
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/flatspark/src/flatspark/skins/ButtonIconSkin.mxml 
b/frameworks/projects/flatspark/src/flatspark/skins/ButtonIconSkin.mxml
index 6965f79..f4a71fa 100644
--- a/frameworks/projects/flatspark/src/flatspark/skins/ButtonIconSkin.mxml
+++ b/frameworks/projects/flatspark/src/flatspark/skins/ButtonIconSkin.mxml
@@ -75,10 +75,7 @@ limitations under the License.
                                if (cornerRadius != cr)
                                {
                                        cornerRadius = cr;
-                                       fill_up.radiusX = cornerRadius;
-                                       fill_over.radiusX = cornerRadius;
-                                       fill_down.radiusX = cornerRadius;
-                                       fill_disabled.radiusX = cornerRadius;
+                                       fill.radiusX = cornerRadius;
                                }
                                
                                super.updateDisplayList(unscaledWidth, 
unscaledHeight);
@@ -165,31 +162,15 @@ limitations under the License.
        
        <!-- layer 2: fill -->
        <!--- @private -->
-       <s:Rect id="fill_up" left="1" right="1" top="1" bottom="1" radiusX="6" 
includeIn="up">
+       <s:Rect id="fill" left="1" right="1" top="1" bottom="1" radiusX="6">
                <s:fill>
-                       <s:SolidColor 
color="{ColorUtils.ButtonColor(hostComponent.brand,stateUp)}"/>
+                       <s:SolidColor 
color.up="{ColorUtils.ButtonColor(hostComponent.brand,stateUp)}"
+                                                 
color.over="{ColorUtils.ButtonColor(hostComponent.brand,stateOver)}"
+                                                 
color.down="{ColorUtils.ButtonColor(hostComponent.brand,stateDown)}"
+                                                 
color.disabled="{ColorUtils.ButtonColor(hostComponent.brand,stateDisabled)}"/>
                </s:fill>
        </s:Rect>
        
-       <s:Rect id="fill_over" left="1" right="1" top="1" bottom="1" 
radiusX="6" includeIn="over">
-               <s:fill>
-                       <s:SolidColor 
color="{ColorUtils.ButtonColor(hostComponent.brand,stateOver)}"/>
-               </s:fill>
-       </s:Rect>
-       
-       <s:Rect id="fill_down" left="1" right="1" top="1" bottom="1" 
radiusX="6" includeIn="down">
-               <s:fill>
-                       <s:SolidColor 
color="{ColorUtils.ButtonColor(hostComponent.brand,stateDown)}"/>
-               </s:fill>
-       </s:Rect>
-       
-       <s:Rect id="fill_disabled" left="1" right="1" top="1" bottom="1" 
radiusX="6" includeIn="disabled">
-               <s:fill>
-                       <s:SolidColor 
color="{ColorUtils.ButtonColor(hostComponent.brand,stateDisabled)}"/>
-               </s:fill>
-       </s:Rect>
-       
-       
        <!-- layer 8: text -->
        <!--- @copy spark.components.supportClasses.ButtonBase#labelDisplay  -->
        <s:HGroup verticalAlign="middle" verticalCenter="0" 
horizontalAlign="center" horizontalCenter="0" left="10" right="10" top="2" 
bottom="2">

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/60488ec5/frameworks/projects/flatspark/src/flatspark/skins/ButtonSkin.mxml
----------------------------------------------------------------------
diff --git a/frameworks/projects/flatspark/src/flatspark/skins/ButtonSkin.mxml 
b/frameworks/projects/flatspark/src/flatspark/skins/ButtonSkin.mxml
index 966497f..fc12a06 100644
--- a/frameworks/projects/flatspark/src/flatspark/skins/ButtonSkin.mxml
+++ b/frameworks/projects/flatspark/src/flatspark/skins/ButtonSkin.mxml
@@ -75,10 +75,7 @@ limitations under the License.
                                if (cornerRadius != cr)
                                {
                                        cornerRadius = cr;
-                                       fill_up.radiusX = cornerRadius;
-                                       fill_over.radiusX = cornerRadius;
-                                       fill_down.radiusX = cornerRadius;
-                                       fill_disabled.radiusX = cornerRadius;
+                                       fill.radiusX = cornerRadius;
                                }
                                
                                super.updateDisplayList(unscaledWidth, 
unscaledHeight);
@@ -126,31 +123,15 @@ limitations under the License.
        
        <!-- layer 2: fill -->
        <!--- @private -->
-       <s:Rect id="fill_up" left="1" right="1" top="1" bottom="1" radiusX="6" 
includeIn="up">
+       <s:Rect id="fill" left="1" right="1" top="1" bottom="1" radiusX="6">
                <s:fill>
-                       <s:SolidColor 
color="{ColorUtils.ButtonColor(BrandColorEnum.Default,stateUp)}"/>
+                       <s:SolidColor 
color.up="{ColorUtils.ButtonColor(BrandColorEnum.Default,stateUp)}"
+                                                 
color.over="{ColorUtils.ButtonColor(BrandColorEnum.Default,stateOver)}"
+                                                 
color.down="{ColorUtils.ButtonColor(BrandColorEnum.Default,stateDown)}"
+                                                 
color.disabled="{ColorUtils.ButtonColor(BrandColorEnum.Default,stateDisabled)}"/>
                </s:fill>
        </s:Rect>
-       
-       <s:Rect id="fill_over" left="1" right="1" top="1" bottom="1" 
radiusX="6" includeIn="over">
-               <s:fill>
-                       <s:SolidColor 
color="{ColorUtils.ButtonColor(BrandColorEnum.Default,stateOver)}"/>
-               </s:fill>
-       </s:Rect>
-       
-       <s:Rect id="fill_down" left="1" right="1" top="1" bottom="1" 
radiusX="6" includeIn="down">
-               <s:fill>
-                       <s:SolidColor 
color="{ColorUtils.ButtonColor(BrandColorEnum.Default,stateDown)}"/>
-               </s:fill>
-       </s:Rect>
-       
-       <s:Rect id="fill_disabled" left="1" right="1" top="1" bottom="1" 
radiusX="6" includeIn="disabled">
-               <s:fill>
-                       <s:SolidColor 
color="{ColorUtils.ButtonColor(BrandColorEnum.Default,stateDisabled)}"/>
-               </s:fill>
-       </s:Rect>
-       
-       
+               
        <!-- layer 8: text -->
        <!--- @copy spark.components.supportClasses.ButtonBase#labelDisplay  -->
        <!--- @see initializationComplete() -->

Reply via email to