A couple of updates to MinimalComps.
First, go over to soulwire and check out the great GUI tool created there. One thing that struck me about it was the dark colors on the components. I liked it and set out to create a similar theme by setting dark values on the Style class. Easy enough. But I didn’t want to go through that every time I wanted to create the same look, so I added a new method on Style, called Style.setStyle. This can be “light” or “dark” (Style.LIGHT or Style.DARK). If you don’t set it, or set it to light, you’ll get something like this:
But with one line:
Style.setStyle(Style.DARK);
you can instead have this:
I like it a lot. If you haven’t used the Style class before, It’s just a list of static vars containing colors that are used whenever a component draws itself. Setting a value on Style does NOT update anything that’s already created, until that component re-draws itself, if it ever does. You should set your style values BEFORE you create a single component, and not change them, unless your’e going to take responsibility for redrawing anything. Same goes for this new method. If anyone comes up with any other useful preset styles that look decent, send them over and if I like them, I may add them to Style. And you’ll win a free set of Minimal Components!
The other change I made is to the HBox and VBox. These have really been bugging me because HBoxes always top-align their contents, and VBoxes always left-align their contents. You can set the x position of an element in a VBox and the y position of an element in a HBox, but it was tricky and non-dynamic. Now they each have an alignment property. This can be top, middle, bottom, or none for HBox and left, center, right, or none for VBox. These are static constants on the respective classes as well (HBox.TOP, HBox.MIDDLE, etc.).
The default alignment for both is NONE, meaning that they’ll work the way they always have. Left and top aligned, unless you’ve set the x or y property of an element as just described. If you set the alignment to anything else, it will ignore the current x or y property and align them exactly as you would expect. Here’s a demo:
[kml_flashembed publishmethod=”static” fversion=”10.0.0″ movie=”http://www.bit-101.com/blog/wp-content/uploads/2011/01/boxalign.swf” width=”450″ height=”300″ targetclass=”flashmovie”]
[/kml_flashembed]
All these changes are checked into SVN. I have one other thing that I’m working on before I go and release a new SWC though.
Many Excellent Posts…… with in a short period….. Really cool…. Dark style mesmerizing me
Can we make our custom theme like this?
You can just set all the Style properties to whatever you want. Look inside of Style.setStyle to see what you need to set.
You could also edit Style.setStyle to add your own presets if you wanted.
Hi
Thanks for sharing these components.
Style.as seems to have no DARK property nor a setStyle method in the ZIP file commited in Google Code. Had to open the SVN version and copy/paste in the unzipped file.
Is it possible to have the type of slider whose thumb grows/shrinks relative to the track?
Thanks!
Is there a way of knowing if a toggle is toggled so as to change the design? Currently the toggled state is very similar to the non-toggled so it is a little bit confusing for me.
Thanks
What is a toggle? You mean a button?
yes. toggle behavior in push buttons
Just checked in something for that. will announce soon.
A writeup about a project that I did that makes use of your Minimal Comps: http://golancourses.net/2011spring/01/26/project-2-new-faces-mauricio-giraldo/