mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07: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:
@@ -79,7 +79,11 @@ notify_treecell_property_mapper (GtkTreeViewColumn *col, GtkCellRenderer *cell,
|
||||
COLOUR_COLUMN, &colour,
|
||||
model_column, &text, -1);
|
||||
g_object_set (G_OBJECT (cell), "text", text, NULL);
|
||||
g_object_set (G_OBJECT (cell), PALETTE_FOREGROUND_PROPERTY, colour, NULL);
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
g_object_set (G_OBJECT (cell), "foreground-rgba", colour, NULL);
|
||||
#else
|
||||
g_object_set (G_OBJECT (cell), "foreground-gdk", colour, NULL);
|
||||
#endif
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
@@ -87,8 +91,15 @@ static void
|
||||
notify_store_color (GtkListStore *store, GtkTreeIter *iter, const PaletteColor *color)
|
||||
{
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
const GdkRGBA *rgba = color;
|
||||
gtk_list_store_set (store, iter, COLOUR_COLUMN, rgba, -1);
|
||||
if (color)
|
||||
{
|
||||
GdkRGBA rgba = *color;
|
||||
gtk_list_store_set (store, iter, COLOUR_COLUMN, &rgba, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_list_store_set (store, iter, COLOUR_COLUMN, NULL, -1);
|
||||
}
|
||||
#else
|
||||
gtk_list_store_set (store, iter, COLOUR_COLUMN, color, -1);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user