#include "gtksizerequest.h"
#include "gtksnapshot.h"
#include "gtkrenderbackgroundprivate.h"
-#include "gtkstylecontextprivate.h"
#include "gtktypebuiltins.h"
#include "gtkviewport.h"
#include "gtkwidgetprivate.h"
if (priv->rubberband_first && priv->rubberband_last)
{
- GtkStyleContext *context;
+ GtkCssStyle *style;
GSequenceIter *iter, *iter1, *iter2;
GdkRectangle line_rect, rect;
GArray *lines;
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (x, y, width, height));
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_save_to_node (context, priv->rubberband_node);
+ style = gtk_css_node_get_style (priv->rubberband_node);
iter1 = CHILD_PRIV (priv->rubberband_first)->iter;
iter2 = CHILD_PRIV (priv->rubberband_last)->iter;
if (lines->len > 0)
{
cairo_path_t *path;
- GtkBorder border;
const GdkRGBA *border_color;
+ int border_width;
GtkSnapshot *bg_snapshot;
GskRenderNode *node;
cairo_clip (cr);
bg_snapshot = gtk_snapshot_new ();
- gtk_css_boxes_init_border_box (&boxes,
- gtk_style_context_lookup_style (context),
- x, y, width, height);
+ gtk_css_boxes_init_border_box (&boxes, style, x, y, width, height);
gtk_css_style_snapshot_background (&boxes, bg_snapshot);
node = gtk_snapshot_free_to_node (bg_snapshot);
if (node)
cairo_append_path (cr, path);
cairo_path_destroy (path);
- border_color = gtk_css_color_value_get_rgba (_gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
- gtk_style_context_get_border (context, &border);
+ border_color = gtk_css_color_value_get_rgba (style->border->border_top_color ? style->border->border_top_color : style->core->color);
+ border_width = round (_gtk_css_number_value_get (style->border->border_left_width, 100));
- cairo_set_line_width (cr, border.left);
+ cairo_set_line_width (cr, border_width);
gdk_cairo_set_source_rgba (cr, border_color);
cairo_stroke (cr);
}
g_array_free (lines, TRUE);
- gtk_style_context_restore (context);
cairo_destroy (cr);
}
}