From 647f8fb2fb09a669efdf00d86bb788bb5be4abe4 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sat, 12 Mar 2011 17:02:49 +0100 Subject: [PATCH] themingengine: Use render_background_internal() to render handle background Instead of using always the background color. This fixes handles that have a background image like gnome-panel applets in a transparent panel. https://bugzilla.gnome.org/show_bug.cgi?id=644570 --- gtk/gtkthemingengine.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c index 717d530732..df09426abe 100644 --- a/gtk/gtkthemingengine.c +++ b/gtk/gtkthemingengine.c @@ -2662,12 +2662,14 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine, GtkStateFlags flags; GdkRGBA *bg_color; GdkRGBA lighter, darker; + GtkJunctionSides sides; gint xx, yy; cairo_save (cr); flags = gtk_theming_engine_get_state (engine); - cairo_set_line_width (cr, 1); + cairo_set_line_width (cr, 1.0); + sides = gtk_theming_engine_get_junction_sides (engine); gtk_theming_engine_get (engine, flags, "background-color", &bg_color, @@ -2675,19 +2677,10 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine, color_shade (bg_color, 0.7, &darker); color_shade (bg_color, 1.3, &lighter); - gdk_cairo_set_source_rgba (cr, bg_color); - cairo_rectangle (cr, x, y, width, height); - cairo_fill (cr); + render_background_internal (engine, cr, x, y, width, height, sides); if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_GRIP)) { - GtkJunctionSides sides; - - cairo_save (cr); - - cairo_set_line_width (cr, 1.0); - sides = gtk_theming_engine_get_junction_sides (engine); - /* reduce confusing values to a meaningful state */ if ((sides & (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT)) == (GTK_JUNCTION_CORNER_TOPLEFT | GTK_JUNCTION_CORNER_BOTTOMRIGHT)) sides &= ~GTK_JUNCTION_CORNER_TOPLEFT; @@ -2932,8 +2925,6 @@ gtk_theming_engine_render_handle (GtkThemingEngine *engine, yi += 3; } } - - cairo_restore (cr); } else if (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_PANE_SEPARATOR)) {