Commit 8d94140d authored by Benjamin Otte's avatar Benjamin Otte

roundedbox: Take a GtkCssStyle instead of a GtkStyleContext

This is in preparation for iusing GtkCssStyle instead of GtkStyleContext
in render functions.
parent 73b3b9ee
......@@ -939,7 +939,7 @@ render_frame_internal (GtkStyleContext *context,
colors[3] = *_gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_COLOR));
_gtk_rounded_box_init_rect (&border_box, x, y, width, height);
_gtk_rounded_box_apply_border_radius_for_context (&border_box, context, junction);
_gtk_rounded_box_apply_border_radius_for_style (&border_box, gtk_style_context_lookup_style (context), junction);
render_border (cr, &border_box, border_width, hidden_side, colors, border_style);
}
......@@ -1185,7 +1185,7 @@ gtk_do_render_focus (GtkStyleContext *context,
- border_width[GTK_CSS_RIGHT] - offset,
- border_width[GTK_CSS_LEFT] - offset,
- border_width[GTK_CSS_BOTTOM] - offset);
_gtk_rounded_box_apply_outline_radius_for_context (&border_box, context, GTK_JUNCTION_NONE);
_gtk_rounded_box_apply_outline_radius_for_style (&border_box, gtk_style_context_lookup_style (context), GTK_JUNCTION_NONE);
render_border (cr, &border_box, border_width, 0, colors, border_style);
}
......@@ -2477,7 +2477,7 @@ gtk_render_content_path (GtkStyleContext *context,
g_return_if_fail (cr != NULL);
_gtk_rounded_box_init_rect (&box, x, y, width, height);
_gtk_rounded_box_apply_border_radius_for_context (&box, context, 0);
_gtk_rounded_box_apply_border_radius_for_style (&box, gtk_style_context_lookup_style (context), 0);
_gtk_rounded_box_shrink (&box,
_gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100)
......
......@@ -115,31 +115,31 @@ _gtk_rounded_box_apply_border_radius (GtkRoundedBox *box,
}
void
_gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box,
GtkStyleContext *context,
GtkJunctionSides junction)
_gtk_rounded_box_apply_border_radius_for_style (GtkRoundedBox *box,
GtkCssStyle *style,
GtkJunctionSides junction)
{
GtkCssValue *corner[4];
corner[GTK_CSS_TOP_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS);
corner[GTK_CSS_TOP_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS);
corner[GTK_CSS_BOTTOM_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS);
corner[GTK_CSS_BOTTOM_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS);
corner[GTK_CSS_TOP_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS);
corner[GTK_CSS_TOP_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_RIGHT_RADIUS);
corner[GTK_CSS_BOTTOM_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_LEFT_RADIUS);
corner[GTK_CSS_BOTTOM_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_RIGHT_RADIUS);
_gtk_rounded_box_apply_border_radius (box, corner, junction);
}
void
_gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox *box,
GtkStyleContext *context,
GtkJunctionSides junction)
_gtk_rounded_box_apply_outline_radius_for_style (GtkRoundedBox *box,
GtkCssStyle *style,
GtkJunctionSides junction)
{
GtkCssValue *corner[4];
corner[GTK_CSS_TOP_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS);
corner[GTK_CSS_TOP_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS);
corner[GTK_CSS_BOTTOM_LEFT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS);
corner[GTK_CSS_BOTTOM_RIGHT] = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS);
corner[GTK_CSS_TOP_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_TOP_LEFT_RADIUS);
corner[GTK_CSS_TOP_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_TOP_RIGHT_RADIUS);
corner[GTK_CSS_BOTTOM_LEFT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_LEFT_RADIUS);
corner[GTK_CSS_BOTTOM_RIGHT] = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_BOTTOM_RIGHT_RADIUS);
_gtk_rounded_box_apply_border_radius (box, corner, junction);
}
......
......@@ -47,13 +47,13 @@ void _gtk_rounded_box_init_rect (GtkRoundedBox
double width,
double height);
void _gtk_rounded_box_apply_border_radius_for_context (GtkRoundedBox *box,
GtkStyleContext *context,
void _gtk_rounded_box_apply_border_radius_for_style (GtkRoundedBox *box,
GtkCssStyle *style,
GtkJunctionSides junction);
void _gtk_rounded_box_apply_outline_radius_for_context (GtkRoundedBox *box,
GtkStyleContext *context,
GtkJunctionSides junction);
void _gtk_rounded_box_apply_outline_radius_for_style (GtkRoundedBox *box,
GtkCssStyle *style,
GtkJunctionSides junction);
void _gtk_rounded_box_grow (GtkRoundedBox *box,
double top,
......
......@@ -278,7 +278,7 @@ _gtk_theming_background_init_context (GtkThemingBackground *bg,
* right now we just shrink to the default.
*/
_gtk_rounded_box_init_rect (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], 0, 0, width, height);
_gtk_rounded_box_apply_border_radius_for_context (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], bg->context, junction);
_gtk_rounded_box_apply_border_radius_for_style (&bg->boxes[GTK_CSS_AREA_BORDER_BOX], gtk_style_context_lookup_style (bg->context), junction);
bg->boxes[GTK_CSS_AREA_PADDING_BOX] = bg->boxes[GTK_CSS_AREA_BORDER_BOX];
_gtk_rounded_box_shrink (&bg->boxes[GTK_CSS_AREA_PADDING_BOX],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment