[gtk/deprecate-render: 15/43] popover: Port to the gtk_css_style_snapshot api




commit 2b00b64e8cbda9d1aaa4db6f998d756c9d74d1b3
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 8 13:45:25 2022 -0400

    popover: Port to the gtk_css_style_snapshot api
    
    The gtk_snapshot_render api is deprecated, so avoid using it.

 gtk/gtkpopover.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index f9f92d7ea1..b281a408a5 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -118,7 +118,8 @@
 #include "gdk/gdkeventsprivate.h"
 #include "gtkpointerfocusprivate.h"
 #include "gtkcsscolorvalueprivate.h"
-#include "deprecated/gtkrender.h"
+#include "gtksnapshot.h"
+#include "gtkrenderbackgroundprivate.h"
 #include "gtkshortcutmanager.h"
 #include "gtkbuildable.h"
 #include "gtktooltipprivate.h"
@@ -1550,6 +1551,7 @@ create_arrow_render_node (GtkPopover *popover)
   GtkSnapshot *snapshot;
   GtkSnapshot *bg_snapshot;
   GskRenderNode *node;
+  GtkCssBoxes boxes;
 
   snapshot = gtk_snapshot_new ();
 
@@ -1572,13 +1574,12 @@ create_arrow_render_node (GtkPopover *popover)
 
   /* Render the arrow background */
   bg_snapshot = gtk_snapshot_new ();
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_snapshot_render_background (bg_snapshot,
-                                  context,
-                                  0, 0,
-                                  gtk_widget_get_width (widget),
-                                  gtk_widget_get_height (widget));
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_css_boxes_init_border_box (&boxes,
+                                 gtk_style_context_lookup_style (context),
+                                 0, 0,
+                                 gtk_widget_get_width (widget),
+                                 gtk_widget_get_height (widget));
+  gtk_css_style_snapshot_background (&boxes, snapshot);
   node = gtk_snapshot_free_to_node (bg_snapshot);
   if (node)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]