Parsed palette color strings with RGBA/GdkColor parsing fallbacks for GTK3/GTK2 palette updates.

Adjusted setup RGBA conversion fallback to explicit channel conversion when parsing fails.
Updated GtkCellRendererText foreground property handling for GTK2/GTK3 in user list, DCC list, and notify list rendering.
This commit is contained in:
2026-01-22 23:45:02 -07:00
parent 5596c8825b
commit 864bf5e059
5 changed files with 29 additions and 12 deletions

View File

@@ -47,12 +47,13 @@
static void
palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint16 blue)
{
#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA parsed;
gboolean parsed_ok;
char color_string[16];
g_snprintf (color_string, sizeof (color_string), "#%04x%04x%04x", red, green, blue);
#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA parsed;
gboolean parsed_ok;
parsed_ok = gdk_rgba_parse (&parsed, color_string);
if (!parsed_ok)
{
@@ -63,10 +64,13 @@ palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint1
}
*color = parsed;
#else
color->red = red;
color->green = green;
color->blue = blue;
color->pixel = 0;
if (!gdk_color_parse (color_string, color))
{
color->red = red;
color->green = green;
color->blue = blue;
color->pixel = 0;
}
#endif
}