Subscribe to RSS
get email updates
home | about | pixDif AIR app | video tutorials
polyGeek.com

place your ad here

Web Premium



Get Qwest High Speed Internet



Could the style names for the various states of text colors on Buttons make less sense?

April 1st, 2009 . by polygeek

First off, kudos to the Flex Builder team for creating a remarkable framework. You guys/gals rock! 99.9 % of the time.

<rant>

With that being said, what the frak were you thinking about when you named the styles for the font colors on <Button> states? You started out good with the Embed skin names:  upSkin, overSkin, pressSkin, disabledSkin. No problems there. All very self descriptive. Thank you.

However, to change the text color on a button for those 4 states is a bit tricky. First there’s color. That’s just the default color of the text in the up-state. The style name is a bit ambiguous don’t you think? Perhaps textColorUp would be more appropriate.

I don’t change the text colors for the hover and press states all the time so it’s easy to forget what they are. When I do look for them I look for, naturally, over and press text colors. But there aren’t any. This time the style names are perfectly descriptive textRollOverColor and textSelectedColor. The problem is that the skins are named by overSkin and pressSkin, respectively. One or the other would be just fine. I’d vote for textOverColor and textPressColor.

Besides, if I didn’t know any better I’d think that textSelectedColor was the color of the text when it is selected with the mouse.

Then we get to the last state: disabled. Or if you are more politically correct then call it the mousePressChallenged state. :) The style for this state is disabledColor. Which again begs the question: the color of what part of the button in the disabled state?

When I name properties I try to keep things grouped so that they all show up together in the code hinting and also so that if you find one of them you’ll know the other 3. I would name the styles as such:

  • textColorUp
  • textColorOver
  • textColorPressed
  • textColorDisabled

Then all anyone would have to do is type textC… and get the code hinting for all of the textColor states.

</rant>

At least now that I’ve bothered to blog about this I’m more likely to remember the cryptic styles names in the future. But then hopefully the style names will change in Gumbo and I won’t have to burden my feeble brain with these details.

If something here has proved valuable to you then feel free to drop a couple of bucks in the tip-jar.

Post to Twitter Post to Delicious Post to Facebook Post to Reddit Post to StumbleUpon


similar posts

5 Responses to “Could the style names for the various states of text colors on Buttons make less sense?”


comment number 1 by: Tangent

The CSS attribute for HTML font color is also "color", so I believe that it is designed to have some sort of alignment with CSS defined in W3C. I agree with you that textColorUp would make more sense, but it would bring up some inconsistencies that others may rant about. Life is tough.

comment number 2 by: polyGeek

@Tangent, "Life is tough" Actually when you consider this is worth gripping about I'd say life is pretty damn good! :)

And what is this HTML thing you speak of? I vaguely recall hearing about it in the past. I've probably supressed those memories due to their tragic nature. :)

comment number 3 by: Harry

And the LinkButton is even worse because it inherits all the inconsistancies of Button, PLUS it adds: "rollOverColor", "selectionColor", but they have nothing for selected color. I had to use a Degrafa skin to draw a rounded rectangle to simulate LinkButton being written to properly include all the necessary styles.

Save me, Gumbo!!!!

comment number 4 by: polyGeek

@Harry, I think our new mantra should be "Gumbo, take me away!" :)

And hey, I love your site. That is wicked cool. Let me know when you add a blog to it.

comment number 5 by: vinoth

this site is very useful in name decerate my name is VINOTH this name create to other style font colour and size then send my e mail id plzzzzzzzzz

   Welcome back (Change)

Leave a Reply

comment feed RSS   subscribe to this comment thread

Recent Posts

   



polyGeek.com

© Copyright 2008 polyGeek.com / Dan Florio, All Rights Reserved Except Where Explicitly Stated
Web Developement Blogs - Blog Catalog Blog Directory
M2 Websites
Local Directory for Los Angeles, CA

Better Tag Cloud