mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-16 18:50:19 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user