summaryrefslogtreecommitdiff
path: root/gtk/gtkthemingbackground.c
diff options
context:
space:
mode:
authorChris Cummins <christopher.e.cummins@intel.com>2013-04-05 10:54:03 +0100
committerRob Bradford <rob@linux.intel.com>2013-04-09 12:52:47 +0100
commitf478f16dbad1da98f812edf5a96e09e140ba36bb (patch)
treebfb4d411b40f8d34d63b4104fc3b20f5f4bc5ae7 /gtk/gtkthemingbackground.c
parentb37d83e98825af0eb3b5e644701b36a24dfd6212 (diff)
downloadgtk+-f478f16dbad1da98f812edf5a96e09e140ba36bb.tar.gz
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 <rob@linux.intel.com>
Diffstat (limited to 'gtk/gtkthemingbackground.c')
-rw-r--r--gtk/gtkthemingbackground.c10
1 files changed, 7 insertions, 3 deletions
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);
}