flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DarkStone <DarkSt...@163.com>
Subject Re: [4.13.0][FLEX-34689] SkinnableComponent change skin bug (Already solved, awaiting review by others)
Date Wed, 17 Dec 2014 05:36:54 GMT
Hi Alex,

Why this needs to be fixed is simple:

1. Using MySkinnableComponent.setStyle("skinClass", SkinA) to apply an initial skin is ok.

2. Then using MySkinnableComponent.styleName = "skinB" won't work, the skin won't change.

The styleChanged() function in SkinnableComponent doesn't handle this scenario correctly,
that's why we need to override the styleName setter function to fix this.

Sent from DarkStone's iPhone
2014-12-17

> 在 2014年12月17日,0:19,Alex Harui <aharui@adobe.com> 写道:
> 
> Hi Darkstone,
> 
> Can you provide more details on why this change is needed?  In theory, the
> SkinnableComponent.styleChanged() method should have seen the styleName
> change.
> 
> -Alex
> 
>> On 12/16/14, 1:27 AM, "DarkStone" <darkstone@163.com> wrote:
>> 
>> Hi,
>> 
>> I found a bug of SkinnableComponent, when use the styleName property to
>> change the skin, in certain circumstances it does not work, the skin
>> won't change!
>> 
>> I've already created the JIRA issue for this bug:
>> https://issues.apache.org/jira/browse/FLEX-34689
>> 
>> I've already figured it out how to fix this bug, it's very eazy to fix:
>> 
>> Just modify the source code of SkinnableComponent.as, and add the
>> following code to the class:
>> 
>> override public function set styleName(value:Object):void
>> {
>>   clearStyle("skinClass");
>>   super.styleName = value;
>> }
>> 
>> This will solve this bug, and I've tested it in different scenarios, it
>> works correctly!
>> 
>> I have trouble connecting to the Flex Git, the network right now is very
>> crappy, may someone review this, if passed, may he commit this change to
>> the Git, that will be very nice : - )
>> 
>> 
>> DarkStone
>> 2014-12-16
> 


Mime
View raw message