[gtk/deprecate-render: 29/36] popover: Stop using gtk_style_context_save_to_node
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/deprecate-render: 29/36] popover: Stop using gtk_style_context_save_to_node
- Date: Sun, 9 Oct 2022 12:13:10 +0000 (UTC)
commit a00bf26ceaee2ce556f7543a2e722a272147e9b4
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Oct 8 23:13:01 2022 -0400
popover: Stop using gtk_style_context_save_to_node
gtk/gtkpopover.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index b281a408a5..326398dbcd 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -126,7 +126,6 @@
#include "gtkcssboxesimplprivate.h"
#include "gtknativeprivate.h"
-#include "gtkstylecontextprivate.h"
#include "gtkroundedboxprivate.h"
#include "gsk/gskroundedrectprivate.h"
#include "gtkcssshadowvalueprivate.h"
@@ -1545,13 +1544,13 @@ create_arrow_render_node (GtkPopover *popover)
{
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
GtkWidget *widget = GTK_WIDGET (popover);
- GtkStyleContext *context;
GtkBorder border;
cairo_t *cr;
GtkSnapshot *snapshot;
GtkSnapshot *bg_snapshot;
GskRenderNode *node;
GtkCssBoxes boxes;
+ GtkCssStyle *style;
snapshot = gtk_snapshot_new ();
@@ -1569,13 +1568,11 @@ create_arrow_render_node (GtkPopover *popover)
get_border (priv->arrow_node, &border);
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_save_to_node (context, priv->arrow_node);
+ style = gtk_css_node_get_style (priv->arrow_node);
/* Render the arrow background */
bg_snapshot = gtk_snapshot_new ();
- gtk_css_boxes_init_border_box (&boxes,
- gtk_style_context_lookup_style (context),
+ gtk_css_boxes_init_border_box (&boxes, style,
0, 0,
gtk_widget_get_width (widget),
gtk_widget_get_height (widget));
@@ -1590,10 +1587,8 @@ create_arrow_render_node (GtkPopover *popover)
/* Render the border of the arrow tip */
if (border.bottom > 0)
{
- GtkCssStyle *style;
const GdkRGBA *border_color;
- style = gtk_css_node_get_style (priv->arrow_node);
border_color = gtk_css_color_value_get_rgba (style->border->border_left_color ?
style->border->border_left_color : style->core->color);
gtk_popover_apply_tail_path (popover, cr);
@@ -1606,8 +1601,6 @@ create_arrow_render_node (GtkPopover *popover)
cairo_restore (cr);
cairo_destroy (cr);
- gtk_style_context_restore (context);
-
priv->arrow_render_node = gtk_snapshot_free_to_node (snapshot);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]