From f478f16dbad1da98f812edf5a96e09e140ba36bb Mon Sep 17 00:00:00 2001 From: Chris Cummins Date: Fri, 5 Apr 2013 10:54:03 +0100 Subject: cds: enable outset shadows Adds conditional code paths to GdkCssShadowValue for painting outset shadows, and allows shadows to be applied in two passes (first outset then inset). This can be used to draw csd shadows in outer window borders. https://bugzilla.gnome.org/show_bug.cgi?id=695998 Signed-off-by: Rob Bradford --- gtk/gtkthemingbackground.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gtk/gtkthemingbackground.c') diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c index 579d2be4de..706752b082 100644 --- a/gtk/gtkthemingbackground.c +++ b/gtk/gtkthemingbackground.c @@ -265,11 +265,13 @@ _gtk_theming_background_paint_layer (GtkThemingBackground *bg, static void _gtk_theming_background_apply_shadow (GtkThemingBackground *bg, - cairo_t *cr) + cairo_t *cr, + gboolean inset) { _gtk_css_shadows_value_paint_box (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BOX_SHADOW), cr, - &bg->padding_box); + &bg->padding_box, + inset); } static void @@ -358,6 +360,8 @@ _gtk_theming_background_render (GtkThemingBackground *bg, cairo_save (cr); cairo_translate (cr, bg->paint_area.x, bg->paint_area.y); + _gtk_theming_background_apply_shadow (bg, cr, FALSE); /* Outset shadow */ + _gtk_theming_background_paint_color (bg, cr, background_image); for (idx = _gtk_css_array_value_get_n_values (background_image) - 1; idx >= 0; idx--) @@ -365,7 +369,7 @@ _gtk_theming_background_render (GtkThemingBackground *bg, _gtk_theming_background_paint_layer (bg, idx, cr); } - _gtk_theming_background_apply_shadow (bg, cr); + _gtk_theming_background_apply_shadow (bg, cr, TRUE); /* Inset shadow */ cairo_restore (cr); } -- cgit v1.2.1