After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 356032 - add support for white-on-black dropshadow to gtk_label
add support for white-on-black dropshadow to gtk_label
Status: RESOLVED DUPLICATE of bug 649314
Product: gtk+
Classification: Platform
Component: Widget: GtkLabel
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on: 355343
Blocks:
 
 
Reported: 2006-09-14 23:50 UTC by Allison Karlitskaya (desrt)
Modified: 2011-06-01 03:59 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
. (8.85 KB, patch)
2006-09-14 23:51 UTC, Allison Karlitskaya (desrt)
none Details | Review
same thing, but using gtk widget style (4.34 KB, patch)
2007-02-21 07:40 UTC, Allison Karlitskaya (desrt)
none Details | Review

Description Allison Karlitskaya (desrt) 2006-09-14 23:50:20 UTC
wanted: an easy way to have a gtklabel display in 'dropshadow' mode (ie: white text with a black dropshadow behind it).

this is done by using the gdkpango 'embossed' attribute with emboss-color set to "black".

the dropshadow attribute can stack with underlines from mnemonics or with markup but cannot stack with a user-supplied attribute list (since the way gtklabel currently works, no copy of made of the list and if we modified it, the user would see our modifications too).

here's some code from a first pass at implementing it.  i've tested a few cases and they seem to work.

the ultimate goal is to be able to use this code inside of gnome applets which display onto a transparent panel.  libgnome-applet currently contains code to find all the labels in the heirarchy and call set_use_dropshadow on the panel background type changing.  there is a problem, though:  new labels added to the applet aren't automatically set to have a dropshadow (unless the user changes the background type after the label is added).

this is all sort of very hacky.  i'm interested in hearing alternate ideas for implementing this -- including some help from the theme engine (which, could for example, look at some property of the toplevel widget when it goes to render the text and decide to render with a dropshadow).  i'm attaching this gtklabel code only as a point at which to start discussion.
Comment 1 Allison Karlitskaya (desrt) 2006-09-14 23:51:01 UTC
Created attachment 72826 [details] [review]
.
Comment 2 Allison Karlitskaya (desrt) 2007-01-27 18:19:58 UTC
any word on this?  seems silly to have merged the gdk part of this patch if gtk isn't going to use it....
Comment 3 Allison Karlitskaya (desrt) 2007-02-21 07:40:52 UTC
Created attachment 83017 [details] [review]
same thing, but using gtk widget style

after talking to matthias on irc we decided that the dropshadow is really more of a theme style thing than something that should be directly exposed to an application via an API like in my first patch.

this patch does exactly that -- it adds a "draw-dropshadow" style property.  a bit of shuffling with respect to stacking order has occured here:

in the old code, if there was a drop shadow user pango attrs would be ignored

in the new code, if there are user pango attrs then the drop shadow is ignored

random: if i write "GtkLabel::draw-dropshadow = TRUE" in my gtkrc it doesn't work.  i have to write "= 1".  i don't know why.  please help?
Comment 4 Xan Lopez 2007-03-01 09:45:45 UTC
TRUE/FALSE are not supported as boolean indicator in RC files, you have to use 1/0. I couldn't find this anywhere in the docs though, so it might be a good idea to add it. That, or write a patch to support it...
Comment 5 Matthias Clasen 2007-03-19 14:55:23 UTC
I have played a bit with this. I don't really like how it hardwires white-on-black
regardless of the state. There are no really good solutions at this time, though.
Using fg-on-black would be a little better, I think. If somebody turns on dropshadows in a style, he can pick a light color for fg, too. Eventually, we could add a style property to set the color of the shadow; but that won't really
solve the state problem. Really, all style properties that select drawing colors
need to be array-valued and allow to override colors per-state.

Another thing I don't like is that you override the embossing for insensitive 
labels. I think you should use gtk_paint_layout for insensitive labels, too.
Comment 6 Matthias Clasen 2011-06-01 03:59:46 UTC

*** This bug has been marked as a duplicate of bug 649314 ***