Hello!

I've tried "make gconfig" for Linux 2.5.67-ac1, and it looks quite bad in
the Red Hat's BlueCurve theme.  Highlighted cells in the tree are
displayed in black on dark blue, so it's hard to see them.

I checked the sources and found that "Black" is hardcoded in gconf.c.
I don't think it's a good idea to override the default color unless you 
have to (i.e. for disabled entries).

Patch is attached.  I'm not a GUI programmer, so please check is there is 
a simpler solution.  Maybe it's possible to use the default foreground for 
insensitive widgets?

Screenshots before and after are here:
http://www.red-bean.com/~proski/gconf/

-- 
Regards,
Pavel Roskin
--- scripts/kconfig/gconf.c
+++ scripts/kconfig/gconf.c
@@ -1184,7 +1184,7 @@ static gchar **fill_row(struct menu *men
        if (show_all && !menu_is_visible(menu))
                row[COL_COLOR] = g_strdup("DarkGray");
        else
-               row[COL_COLOR] = g_strdup("Black");
+               row[COL_COLOR] = NULL;
 
        ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN;
        switch (ptype) {
@@ -1282,15 +1282,19 @@ static gchar **fill_row(struct menu *men
 static void set_node(GtkTreeIter * node, struct menu *menu, gchar ** row)
 {
        GdkColor color;
+       GdkColor *pcolor = NULL;
        gboolean success;
        GdkPixbuf *pix;
 
        pix = gdk_pixbuf_new_from_xpm_data((const char **)
                                           row[COL_PIXBUF]);
 
-       gdk_color_parse(row[COL_COLOR], &color);
-       gdk_colormap_alloc_colors(gdk_colormap_get_system(), &color, 1,
-                                 FALSE, FALSE, &success);
+       if (row[COL_COLOR]) {
+               gdk_color_parse(row[COL_COLOR], &color);
+               gdk_colormap_alloc_colors(gdk_colormap_get_system(), &color, 1,
+                                         FALSE, FALSE, &success);
+               pcolor = &color;
+       }
 
        gtk_tree_store_set(tree, node,
                           COL_OPTION, row[COL_OPTION],
@@ -1300,7 +1304,7 @@ static void set_node(GtkTreeIter * node,
                           COL_YES, row[COL_YES],
                           COL_VALUE, row[COL_VALUE],
                           COL_MENU, (gpointer) menu,
-                          COL_COLOR, &color,
+                          COL_COLOR, pcolor,
                           COL_EDIT, GPOINTER_TO_INT(row[COL_EDIT]),
                           COL_PIXBUF, pix,
                           COL_PIXVIS, GPOINTER_TO_INT(row[COL_PIXVIS]),

Reply via email to