summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-01-17 17:07:01 +0100
committerBenjamin Otte <otte@redhat.com>2015-01-20 06:30:18 +0100
commitcb0ca9a804554d8bf90c88e80802210edbcd6245 (patch)
tree3c298250a7e7f8cf070e1b6f815237fedf807a96
parent5cc0cae4b7a837ecc8cc3114d4851fba9a3e968d (diff)
downloadgtk+-cb0ca9a804554d8bf90c88e80802210edbcd6245.tar.gz
render: Use a GtkCssStyle instead of GtkStyleContext for focus
-rw-r--r--gtk/gtkrender.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index 312231543c..4a95a9cef2 100644
--- a/gtk/gtkrender.c
+++ b/gtk/gtkrender.c
@@ -1130,29 +1130,29 @@ gtk_render_expander (GtkStyleContext *context,
}
static void
-gtk_do_render_focus (GtkStyleContext *context,
- cairo_t *cr,
- gdouble x,
- gdouble y,
- gdouble width,
- gdouble height)
+gtk_css_style_render_focus (GtkCssStyle *style,
+ cairo_t *cr,
+ gdouble x,
+ gdouble y,
+ gdouble width,
+ gdouble height)
{
GtkBorderStyle border_style[4];
GtkRoundedBox border_box;
double border_width[4];
GdkRGBA colors[4];
- border_style[0] = _gtk_css_border_style_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_STYLE));
+ border_style[0] = _gtk_css_border_style_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_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_width[0] = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_WIDTH), 100);
+ border_width[0] = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_WIDTH), 100);
border_width[3] = border_width[2] = border_width[1] = border_width[0];
- colors[0] = *_gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_COLOR));
+ colors[0] = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_COLOR));
colors[3] = colors[2] = colors[1] = colors[0];
- offset = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_OUTLINE_OFFSET), 100);
+ offset = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_OUTLINE_OFFSET), 100);
_gtk_rounded_box_init_rect (&border_box, x, y, width, height);
_gtk_rounded_box_shrink (&border_box,
@@ -1160,7 +1160,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_style (&border_box, gtk_style_context_lookup_style (context), GTK_JUNCTION_NONE);
+ _gtk_rounded_box_apply_outline_radius_for_style (&border_box, style, GTK_JUNCTION_NONE);
render_border (cr, &border_box, border_width, 0, colors, border_style);
}
@@ -1200,7 +1200,9 @@ gtk_render_focus (GtkStyleContext *context,
cairo_save (cr);
cairo_new_path (cr);
- gtk_do_render_focus (context, cr, x, y, width, height);
+ gtk_css_style_render_focus (gtk_style_context_lookup_style (context),
+ cr,
+ x, y, width, height);
cairo_restore (cr);
}