Re: Theme / style problem - shadow on insensitive label



On Tue, Jan 19, 2010 at 06:31:28PM +0000, Robert Pearce wrote:
> I am building an application which includes, among other things, a bunch of radio buttons. One or more of these may, on occasion, be marked "insensitive" because the option is not available. OK so far.
> 
> My customer wants a visual style with white text on a dark blue background. Disabled (i.e. "insensitive") text should be mid-grey. Knowing how much people on here scream and yell about imposing such things, I am implementing that by providing a resource file that defines a theme.
> 
> The problem I have is that when I mark a radio button (or any label) "insensitive", the text acquires a shadow, and this shadow is WHITE! This makes it stand out even more than the active buttons, thus totally going against intent.
> 
> I've tried googling, and all I got was a thread on this list seven years ago in which somebody asked how to remove this shadow and was told in no uncertain terms that he shouldn't be imposing style decisions in the code. Well, I'm trying to use a theme, so please can somebody answer the question for me?

I don't think that the shadowing code path can be avoided just by using
a RC style.   And while GdkPango defines a text attribute for the emboss
color (which is indeed white by default), I can't see how you could
influence it.

So, you can probably write a theme engine, but I might try a sneaky way
first: subclass GtkStyle, override just draw_layout() method with the
code taken from gtk_default_draw_layout() with the insensitive layout
code deleted (which will make the function trivial), and then
instantiate this style and set it on your labels.  I haven't tried it
and, of course, it will interact badly with theme engines but
interaction with theme engines probably isn't something you care about
with such requirements...

Yeti



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]