akamud / FlatSpark

FlatSpark is a flat skin for Flex 4 projects. It is now officially a part of Flex SDK starting from 4.14. Further development will be made in Flex official repository here: (https://github.com/apache/flex-sdk/tree/develop/frameworks/projects/flatspark)
Apache License 2.0
75 stars 35 forks source link

Load this theme with styleManager #2

Closed hferreira closed 10 years ago

hferreira commented 10 years ago

Hello,

This is simply great ! I'm looking forward to see all the missing components with this new look !

Currently I allow the user choose and load the theme on the fly with "styleManager.loadStyleDeclarations2". I'm using a couple of themes provided with the Flex in SWF format.

I can't do the same with this theme.

hferreira commented 10 years ago

Is this project alive ?

akamud commented 10 years ago

Hi @hferreira, sorry for the delay, the project is alive. I'm away from home this week, but I'll be looking into this problem as soon as I get back.

hferreira commented 10 years ago

Hi akamud,

Thank you very much. Your theme is absolutely great. I'm not a designer. I use 4 themes bundle with Flex 4 and load themes (compiled to swf) at runtime with styleManager.loadStyleDeclarations2.

akamud commented 10 years ago

Hi @hferreira, I finally had the time to look into this issue. Right now we don't have a .swf that you can use with styleManager.loadStyleDeclarations2, but I did a quick test and confirmed all you need to do is edit our CSS overriding the spark skin, like so:

s|Button {
    skinClass: ClassReference("flatSpark.skins.ButtonSkin");
}

You would need to do that for all the components you would like to use, and then compile it. That way you can generate a .swf that could be loaded with styleManager.

Right now we are not offering this just because we want to let the user decide which componets they want to skin (More information here). If we added the above declaration in our CSS, FlatSpark would be applied to all default Spark components in an opt-out manner. This is not our goal right now, since it is a project in early stage.

Again, it took me about 5 minutes to generate a .swf with the behavior described by you overriding the Button skin in execution time, so right now I would suggest you generate the swf if you need this functionality. We'll be thinking in a way to provide this funcionality in the future in a way that doesn't confuse the user trying the skin for the first time.

These are the instructions I followed to compile a .swf. Since you already have the .css and .swc from our project, you just need to do the 3rd step. You can download the .swc here. And the .css here. Don't forget to first edit the .css in your machine and add the skins desired. You can see all the skins that are done in here.

I hope I was clear on the instructions, if you have trouble generating the .swf, report back here and I will try to help you further.

hferreira commented 10 years ago

Thank you. Latter I will try to generate the swf myself. Looking forward to see more components skinned.