mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-16 18:50:19 +00:00
Updated GTK3 color parsing in the palette/setup helpers to use RGBA-friendly hex strings with gdk_rgba_parse fallbacks while preserving GTK2 behavior.
Switched GtkCellRendererText foreground property selection to foreground-rgba on GTK3 paths (with GTK2 guarded), covering userlist, notify, and DCC views.
This commit is contained in:
@@ -47,13 +47,13 @@
|
||||
static void
|
||||
palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint16 blue)
|
||||
{
|
||||
char color_string[16];
|
||||
|
||||
g_snprintf (color_string, sizeof (color_string), "#%04x%04x%04x", red, green, blue);
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
char color_string[8];
|
||||
GdkRGBA parsed = { 0 };
|
||||
gboolean parsed_ok;
|
||||
|
||||
g_snprintf (color_string, sizeof (color_string), "#%02x%02x%02x",
|
||||
red >> 8, green >> 8, blue >> 8);
|
||||
parsed_ok = gdk_rgba_parse (&parsed, color_string);
|
||||
if (!parsed_ok)
|
||||
{
|
||||
@@ -64,6 +64,9 @@ palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint1
|
||||
}
|
||||
*color = parsed;
|
||||
#else
|
||||
char color_string[16];
|
||||
|
||||
g_snprintf (color_string, sizeof (color_string), "#%04x%04x%04x", red, green, blue);
|
||||
if (!gdk_color_parse (color_string, color))
|
||||
{
|
||||
color->red = red;
|
||||
|
||||
Reference in New Issue
Block a user