diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c index bfdad8e6ec..f395bece97 100644 --- a/gtk/gtkrender.c +++ b/gtk/gtkrender.c @@ -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) diff --git a/gtk/gtkroundedbox.c b/gtk/gtkroundedbox.c index b439a8f746..bbc89452ae 100644 --- a/gtk/gtkroundedbox.c +++ b/gtk/gtkroundedbox.c @@ -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); } diff --git a/gtk/gtkroundedboxprivate.h b/gtk/gtkroundedboxprivate.h index 3f98e20de6..cdbf1e15ce 100644 --- a/gtk/gtkroundedboxprivate.h +++ b/gtk/gtkroundedboxprivate.h @@ -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, diff --git a/gtk/gtkthemingbackground.c b/gtk/gtkthemingbackground.c index 3478f285c0..8cd8a4b7a8 100644 --- a/gtk/gtkthemingbackground.c +++ b/gtk/gtkthemingbackground.c @@ -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],