PDA

View Full Version : Using default theme color


mu_mind
2010-01-23, 19:58
I'm making a status menu widget on the N900 using python (as described in the wiki (http://wiki.maemo.org/PyMaemo/HildonDesktop#Example_-_Status_menu_widgets_.28Fremantle_only.29)), and I had some questions. I used a hildon.Button object, but I noticed the "value" text on it was gray and on most of the other widgets the color varied with the theme, like the orange text here:
http://farm5.static.flickr.com/4057/4297767483_754119f9db_m.jpg
I'd like to know:

Is there a different Button class that renders the value (secondary text) in the default theme color?
Is there a straightforward way to change the color on an existing Button object's text?
How do you get the theme color (or whatever it's called) from in python?

qwerty12
2010-01-23, 20:09
The grey and the orange used here are both the default theme colours for the HildonButton's value label.

http://maemo.org/api_refs/5.0/5.0-final/hildon/HildonButton.html#hildon-button-set-style will probably explain it better, but, in short, if you want the orange: <HildonButton>.set_style(hildon.BUTTON_STYLE_PICKER)

Note: The button should only be made orange if pressing the button allows its value to be changed in some way...