Standardized GtkCellRendererText foreground bindings to use the palette foreground property macro across user list, notify list, and DCC views (GTK2/GTK3 aware).

Generated GTK3 caret-color CSS using GdkRGBA string conversion instead of manual RGB math for input styling.
Simplified palette RGB16 parsing by building a GdkRGBA-compatible color string before parsing.
This commit is contained in:
2026-01-22 22:25:26 -07:00
parent 61669f6b98
commit 9959cf1f24
5 changed files with 11 additions and 27 deletions

View File

@@ -48,12 +48,13 @@ static void
palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint16 blue)
{
#if GTK_CHECK_VERSION(3,0,0)
char buf[8];
GdkRGBA parsed;
gboolean parsed_ok;
char *color_string;
g_snprintf (buf, sizeof (buf), "#%02x%02x%02x", red >> 8, green >> 8, blue >> 8);
parsed_ok = gdk_rgba_parse (&parsed, buf);
color_string = g_strdup_printf ("#%02x%02x%02x", red >> 8, green >> 8, blue >> 8);
parsed_ok = gdk_rgba_parse (&parsed, color_string);
g_free (color_string);
if (!parsed_ok)
{
parsed.red = red / 65535.0;