pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Setting Default Color
Date Wed, 19 Aug 2009 21:49:00 GMT
Ah. A renderer would definitely work there. You could probably just  
extend the existing org.apache.pivot.wtk.content.ButtonDataRenderer  
class and override render() to check for button.isSelected().

On Aug 19, 2009, at 5:46 PM, Scott Lanham wrote:

> I am changing the colour of the (toggle) buttons text when it is  
> selected to
> highlight it being pushed in.
> On Thu, 20 Aug 2009 07:33:43 am Greg Brown wrote:
>> It occurred to me that this might be a use case for a custom button
>> data renderer. Under what circumstances do you need to change the
>> color? If you use a custom renderer, you might not have to change the
>> button's "color" style at all.
>> On Aug 18, 2009, at 9:45 PM, Greg Brown wrote:
>>> There's no automatic way to tell a skin to revert to a default
>>> color. One way to do this would be to cache the prior value before
>>> you change it, and then use that to restore the original.
>>> Alternatively, you could use the indexed color setter; the default
>>> palette color for a Terra PushButton is 1. So, you can do this:
>>> pushButton.getStyles().put("color", 1);
>>> That will reset the color to the theme default.
>>> G
>>> On Aug 18, 2009, at 9:33 PM, Scott Lanham wrote:
>>>> Hi,
>>>> I am changing the color of the text on a button under certain
>>>> circumstances
>>>> and am wondering if it is possible to set the "color" style back to
>>>> it's
>>>> default prior to me modifying it.
>>>> Thanks,
>>>> Scott.

View raw message