diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-05-20 23:51:16 -0400 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-06-09 23:17:09 +0200 |
commit | b6b66803c015947472424efad75fdecc254709f9 (patch) | |
tree | 42b85d72a13e88cbc06550f827176e52780ccf23 /gtk/gtkshadow.c | |
parent | ef78d5b730cf70158e9efa306444fa77a450750c (diff) | |
download | gtk+-b6b66803c015947472424efad75fdecc254709f9.tar.gz |
shadow: add _gtk_icon_shadow_paint()
Paints a shadow of the current source, using the defined colors.
Diffstat (limited to 'gtk/gtkshadow.c')
-rw-r--r-- | gtk/gtkshadow.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gtk/gtkshadow.c b/gtk/gtkshadow.c index ce84e4bff6..c8757b33ba 100644 --- a/gtk/gtkshadow.c +++ b/gtk/gtkshadow.c @@ -275,3 +275,26 @@ _gtk_text_shadow_paint_layout (GtkShadow *shadow, } } +void +_gtk_icon_shadow_paint (GtkShadow *shadow, + cairo_t *cr) +{ + GList *l; + GtkShadowElement *element; + cairo_pattern_t *pattern; + + for (l = g_list_last (shadow->elements); l != NULL; l = l->prev) + { + element = l->data; + + cairo_save (cr); + pattern = cairo_pattern_reference (cairo_get_source (cr)); + gdk_cairo_set_source_rgba (cr, &element->color); + + cairo_translate (cr, element->hoffset, element->voffset); + cairo_mask (cr, pattern); + + cairo_restore (cr); + cairo_pattern_destroy (pattern); + } +} |