GtkThemingEngine: Add code to render GtkFrame frame with gap.

This commit is contained in:
Carlos Garnacho 2010-08-02 15:52:26 +02:00
parent d858801ec3
commit 1e83e52b3d

View File

@ -1596,6 +1596,72 @@ gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
color_shade (bg_color, 0.7, &darker);
color_shade (bg_color, 1.3, &lighter);
if (gtk_theming_engine_has_class (engine, "frame"))
{
if (gap_side == GTK_POS_RIGHT)
sides = SIDE_BOTTOM;
else if (gap_side == GTK_POS_BOTTOM)
sides = SIDE_RIGHT;
else
sides = SIDE_BOTTOM | SIDE_RIGHT;
gdk_cairo_set_source_color (cr, &lighter);
add_path_rectangle_sides (cr, x , y, width , height, sides);
cairo_stroke (cr);
gdk_cairo_set_source_color (cr, &darker);
add_path_rectangle_sides (cr, x, y, width - 1, height - 1, sides);
cairo_stroke (cr);
if (gap_side == GTK_POS_RIGHT ||
gap_side == GTK_POS_BOTTOM)
{
gdk_cairo_set_source_color (cr, &darker);
add_path_gap_side (cr, gap_side,
x + 1, y + 1, width - 4, height - 4,
xy0_gap, xy1_gap);
cairo_stroke (cr);
gdk_cairo_set_source_color (cr, &lighter);
add_path_gap_side (cr, gap_side,
x, y, width, height,
xy0_gap, xy1_gap);
cairo_stroke (cr);
}
if (gap_side == GTK_POS_LEFT)
sides = SIDE_TOP;
else if (gap_side == GTK_POS_TOP)
sides = SIDE_LEFT;
else
sides = SIDE_TOP | SIDE_LEFT;
gdk_cairo_set_source_color (cr, &lighter);
add_path_rectangle_sides (cr, x + 1, y + 1, width - 2, height - 3, sides);
cairo_stroke (cr);
gdk_cairo_set_source_color (cr, &darker);
add_path_rectangle_sides (cr, x, y, width - 1, height - 1, sides);
cairo_stroke (cr);
if (gap_side == GTK_POS_LEFT ||
gap_side == GTK_POS_TOP)
{
gdk_cairo_set_source_color (cr, &lighter);
add_path_gap_side (cr, gap_side,
x + 1, y + 1, width - 4, height - 4,
xy0_gap, xy1_gap);
cairo_stroke (cr);
gdk_cairo_set_source_color (cr, &darker);
add_path_gap_side (cr, gap_side,
x, y, width - 2, height - 2,
xy0_gap, xy1_gap);
cairo_stroke (cr);
}
}
else
{
if (gap_side == GTK_POS_RIGHT)
sides = SIDE_BOTTOM;
else if (gap_side == GTK_POS_BOTTOM)
@ -1636,7 +1702,6 @@ gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
sides = SIDE_TOP | SIDE_LEFT;
gdk_cairo_set_source_color (cr, &lighter);
add_path_rectangle_sides (cr, x, y, width, height, sides);
cairo_stroke (cr);
@ -1648,6 +1713,7 @@ gtk_theming_engine_render_frame_gap (GtkThemingEngine *engine,
xy0_gap, xy1_gap);
cairo_stroke (cr);
}
}
cairo_restore (cr);