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.
This commit is contained in:
Matthias Clasen 2024-08-02 00:51:09 -04:00
parent ed119ae246
commit d32081401f

View File

@ -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;