mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-16 18:50:19 +00:00
Added a GTK3 fallback when parsing palette RGB16 values into GdkRGBA colors to keep RGBA initialization robust.
Updated GTK3 list-model color storage and GtkCellRendererText foreground properties to use RGBA values in the user list, notify list, and DCC views while retaining GTK2 behavior. Copied palette RGBA values before initializing the GTK3 color chooser dialog to ensure RGBA usage on the GTK3 path.
This commit is contained in:
@@ -50,9 +50,17 @@ palette_color_set_rgb16 (PaletteColor *color, guint16 red, guint16 green, guint1
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
char buf[8];
|
||||
GdkRGBA parsed;
|
||||
gboolean parsed_ok;
|
||||
|
||||
g_snprintf (buf, sizeof (buf), "#%02x%02x%02x", red >> 8, green >> 8, blue >> 8);
|
||||
gdk_rgba_parse (&parsed, buf);
|
||||
parsed_ok = gdk_rgba_parse (&parsed, buf);
|
||||
if (!parsed_ok)
|
||||
{
|
||||
parsed.red = red / 65535.0;
|
||||
parsed.green = green / 65535.0;
|
||||
parsed.blue = blue / 65535.0;
|
||||
parsed.alpha = 1.0;
|
||||
}
|
||||
*color = parsed;
|
||||
#else
|
||||
color->red = red;
|
||||
|
||||
Reference in New Issue
Block a user