From 64b7d9e5c1f40b8f5bcf416bae8eadfad51e65af Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 29 Nov 2010 11:25:09 +0100 Subject: [PATCH] GtkThemingEngine: Render gradients in tabs. Background will be actually rotated in tabs, so the "bottom" side coincides with the junction point, this makes gradients work as expected in rotated tabs. --- gtk/gtkthemingengine.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c index 43444176e6..3f2324bcfd 100644 --- a/gtk/gtkthemingengine.c +++ b/gtk/gtkthemingengine.c @@ -2303,32 +2303,45 @@ gtk_theming_engine_render_extension (GtkThemingEngine *engine, case GTK_POS_LEFT: junction = GTK_JUNCTION_LEFT; hidden_side = SIDE_LEFT; + + cairo_translate (cr, x + width, y); + cairo_rotate (cr, G_PI / 2); break; case GTK_POS_RIGHT: junction = GTK_JUNCTION_RIGHT; hidden_side = SIDE_RIGHT; + + cairo_translate (cr, x, y + height); + cairo_rotate (cr, - G_PI / 2); break; case GTK_POS_TOP: junction = GTK_JUNCTION_TOP; hidden_side = SIDE_TOP; + + cairo_translate (cr, x + width, y + height); + cairo_rotate (cr, G_PI); break; case GTK_POS_BOTTOM: junction = GTK_JUNCTION_BOTTOM; hidden_side = SIDE_BOTTOM; + + cairo_translate (cr, x, y); break; } - state = gtk_theming_engine_get_state (engine); - gtk_theming_engine_get (engine, state, - "background-color", &bg_color, - "border-radius", &radius, - NULL); + if (gap_side == GTK_POS_TOP || + gap_side == GTK_POS_BOTTOM) + render_background_internal (engine, cr, + 0, 0, width, height, + junction); + else + render_background_internal (engine, cr, + 0, 0, height, width, + junction); - _cairo_round_rectangle_sides (cr, radius, - x, y, width, height, - SIDE_ALL, junction); - gdk_cairo_set_source_rgba (cr, bg_color); - cairo_fill (cr); + cairo_restore (cr); + + cairo_save (cr); render_frame_internal (engine, cr, x, y, width, height,