themingengine: Implement outline support

This commit is contained in:
Benjamin Otte
2012-01-08 02:55:34 +01:00
parent 68cfb80631
commit c15839f4be

View File

@ -1794,6 +1794,29 @@ render_frame_internal (GtkThemingEngine *engine,
_gtk_rounded_box_apply_border_radius (&border_box, engine, state, junction);
render_border (cr, &border_box, &border, hidden_side, colors, border_style);
border_style[0] = g_value_get_enum (_gtk_theming_engine_peek_property (engine, "outline-style"));
if (border_style[0] != GTK_BORDER_STYLE_NONE)
{
int offset;
border_style[1] = border_style[2] = border_style[3] = border_style[0];
border.top = g_value_get_int (_gtk_theming_engine_peek_property (engine, "outline-width"));
border.left = border.right = border.bottom = border.top;
colors[0] = *(GdkRGBA *) g_value_get_boxed (_gtk_theming_engine_peek_property (engine, "outline-color"));
colors[3] = colors[2] = colors[1] = colors[0];
offset = g_value_get_int (_gtk_theming_engine_peek_property (engine, "outline-offset"));
/* reinit box here - outlines don't have a border radius */
_gtk_rounded_box_init_rect (&border_box, x, y, width, height);
_gtk_rounded_box_shrink (&border_box,
- border.top - offset,
- border.right - offset,
- border.left - offset,
- border.bottom - offset);
render_border (cr, &border_box, &border, hidden_side, colors, border_style);
}
}
static void