From d32081401f7f0f15108905f827a5578041b52305 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 2 Aug 2024 00:51:09 -0400 Subject: [PATCH] inspector: Show more details for text nodes Show the color state, and create textures with the full color information. The GdkRGBA-based helper functions are no longer used with this commit and have been dropped. --- gtk/inspector/recorder.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c index b27b52ce6b..33c92fd764 100644 --- a/gtk/inspector/recorder.c +++ b/gtk/inspector/recorder.c @@ -826,19 +826,6 @@ get_color2_texture (const GdkColor *color) return texture; } -static GdkTexture * -get_color_texture (const GdkRGBA *rgba) -{ - GdkColor color; - GdkTexture *texture; - - gdk_color_init_from_rgba (&color, rgba); - texture = get_color2_texture (&color); - gdk_color_finish (&color); - - return texture; -} - static GdkTexture * get_linear_gradient_texture (gsize n_stops, const GskColorStop *stops) { @@ -906,21 +893,6 @@ add_text_row (GListStore *store, g_free (text); } -static void -add_color_row (GListStore *store, - const char *name, - const GdkRGBA *color) -{ - char *text; - GdkTexture *texture; - - text = gdk_rgba_to_string (color); - texture = get_color_texture (color); - list_store_add_object_property (store, name, text, texture); - g_free (text); - g_object_unref (texture); -} - static void add_color2_row (GListStore *store, const char *name, @@ -1210,7 +1182,6 @@ populate_render_node_properties (GListStore *store, case GSK_TEXT_NODE: { const PangoFont *font = gsk_text_node_get_font (node); - const GdkRGBA *color = gsk_text_node_get_color (node); const graphene_point_t *offset = gsk_text_node_get_offset (node); PangoFontDescription *desc; GString *s; @@ -1229,7 +1200,7 @@ populate_render_node_properties (GListStore *store, add_text_row (store, "Position", "%.2f %.2f", offset->x, offset->y); - add_color_row (store, "Color", color); + add_color2_row (store, "Color", gsk_text_node_get_color2 (node)); } break;