diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-10-08 14:10:34 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-10-12 15:35:00 -0400 |
commit | dd3c371c08221e2e46ec53cba6ed6889d6fe81b3 (patch) | |
tree | 6967f33d110a564648f6ae7cc490d678a802482b /gtk/gtkinscription.c | |
parent | 3145bce6a1ac7cd9f8d1fb9e9b1d0fb57f9f36a0 (diff) | |
download | gtk+-dd3c371c08221e2e46ec53cba6ed6889d6fe81b3.tar.gz |
inscription: Stop using gtk_snapshot_render api
The gtk_snapshot_render api is deprecated, so avoid using it.
Diffstat (limited to 'gtk/gtkinscription.c')
-rw-r--r-- | gtk/gtkinscription.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gtk/gtkinscription.c b/gtk/gtkinscription.c index d689fc989f..b5ecabac74 100644 --- a/gtk/gtkinscription.c +++ b/gtk/gtkinscription.c @@ -24,7 +24,8 @@ #include "gtkcssnodeprivate.h" #include "gtkcssstylechangeprivate.h" #include "gtkpangoprivate.h" -#include "deprecated/gtkrender.h" +#include "gtksnapshot.h" +#include "gtkrenderlayoutprivate.h" #include "gtktypebuiltins.h" #include "gtkwidgetprivate.h" @@ -510,19 +511,18 @@ gtk_inscription_snapshot (GtkWidget *widget, GtkSnapshot *snapshot) { GtkInscription *self = GTK_INSCRIPTION (widget); - GtkStyleContext *context; float lx, ly; + GtkCssBoxes boxes; if (!self->text || (*self->text == '\0')) return; - context = _gtk_widget_get_style_context (widget); - gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_INIT(0, 0, gtk_widget_get_width (widget), gtk_widget_get_height (widget))); gtk_inscription_get_layout_location (self, &lx, &ly); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - gtk_snapshot_render_layout (snapshot, context, lx, ly, self->layout); -G_GNUC_END_IGNORE_DEPRECATIONS + + gtk_css_boxes_init (&boxes, widget); + gtk_css_style_snapshot_layout (&boxes, snapshot, lx, ly, self->layout); + gtk_snapshot_pop (snapshot); } |