Slick Forums

Discuss the Slick 2D Library
It is currently Thu Jun 20, 2013 4:10 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Nov 08, 2011 7:36 pm 
Offline

Joined: Tue Nov 08, 2011 7:22 pm
Posts: 3
If I set a button to disabled by using .setEnabled(false), the theme picks up the if="disabled" alias but it will switch to the if="hover" alias if the mouse moves over it. This gives the impression that the button is still clickable. Also, it doesn't switch back leaving the button in the hover state.

I thought I could nest the <alias> so all others would go under the default but breaks the rules of the XML so I guess the library doesn't cater for that.

To recreate (if using Eforen.xml):
Under: <select name="eforen.button.background">
Add: <alias ref="-eforen.button" tint="#777777" if="disabled"/>
Call .setEnabled(false) on a button in your program.

The button will be initially darker than the rest but after you hover over it the tint changes to the hover color and doesn't change back. It may also react to keyboard focus. Clicking the button does nothing, as expected.

Is this a bug or am I doing something wrong?

Thanks,

Max


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2011 7:49 pm 
Offline

Joined: Tue Nov 08, 2011 7:22 pm
Posts: 3
Sorry, the button does not return to the disabled state only with libgdx.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2011 7:55 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1190
You can just write "hover + !disabled" to prevent the hover effect when disabled.

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
PostPosted: Thu Nov 10, 2011 4:08 pm 
Offline

Joined: Tue Nov 08, 2011 7:22 pm
Posts: 3
Didn't know you could combine conditions. Worked like a charm. Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group