Commit 858c80f3 authored by Benjamin Otte's avatar Benjamin Otte

render: Replace gtk_style_context_get_border/padding()

Use _gtk_style_context_peek_property() instead.
parent 8b11e93a
......@@ -110,7 +110,10 @@ gtk_do_render_check (GtkStyleContext *context,
fg_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_COLOR));
bg_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
gtk_style_context_get_border (context, flags, &border);
border.top = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
border.right = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
border.bottom = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
border.left = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
border_style = _gtk_css_border_style_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_STYLE));
border_width = MIN (MIN (border.top, border.bottom),
......@@ -266,7 +269,10 @@ gtk_do_render_option (GtkStyleContext *context,
fg_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_COLOR));
bg_color = _gtk_css_rgba_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
gtk_style_context_get_border (context, flags, &border);
border.top = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
border.right = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
border.bottom = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
border.left = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
border_style = _gtk_css_border_style_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_STYLE));
exterior_size = MIN (width, height);
......@@ -1429,16 +1435,17 @@ gtk_do_render_frame_gap (GtkStyleContext *context,
gdouble xy1_gap)
{
GtkJunctionSides junction;
GtkStateFlags state;
gint border_width;
GtkCssValue *corner[4];
gdouble x0, y0, x1, y1, xc = 0.0, yc = 0.0, wc = 0.0, hc = 0.0;
GtkBorder border;
state = gtk_style_context_get_state (context);
junction = gtk_style_context_get_junction_sides (context);
gtk_style_context_get_border (context, state, &border);
border.top = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
border.right = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
border.bottom = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
border.left = _gtk_css_number_value_get (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
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);
......
......@@ -27,6 +27,7 @@
#include "gtkcssbgsizevalueprivate.h"
#include "gtkcssenumvalueprivate.h"
#include "gtkcssimagevalueprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssshadowsvalueprivate.h"
#include "gtkcsspositionvalueprivate.h"
#include "gtkcssrepeatvalueprivate.h"
......@@ -257,11 +258,16 @@ _gtk_theming_background_init_context (GtkThemingBackground *bg,
double height,
GtkJunctionSides junction)
{
GtkStateFlags flags = gtk_style_context_get_state (bg->context);
GtkBorder border, padding;
gtk_style_context_get_border (bg->context, flags, &border);
gtk_style_context_get_padding (bg->context, flags, &padding);
border.top = _gtk_css_number_value_get (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
border.right = _gtk_css_number_value_get (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100);
border.bottom = _gtk_css_number_value_get (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100);
border.left = _gtk_css_number_value_get (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100);
padding.top = _gtk_css_number_value_get (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_PADDING_TOP), 100);
padding.right = _gtk_css_number_value_get (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_PADDING_RIGHT), 100);
padding.bottom = _gtk_css_number_value_get (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_PADDING_BOTTOM), 100);
padding.left = _gtk_css_number_value_get (_gtk_style_context_peek_property (bg->context, GTK_CSS_PROPERTY_PADDING_LEFT), 100);
/* In the CSS box model, by default the background positioning area is
* the padding-box, i.e. all the border-box minus the borders themselves,
......
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