# HG changeset patch # User Marcus Lundblad # Date 1236120979 0 # Node ID 36f6f798e48a541189e778026bf714b253b55a80 # Parent 09f4d4bca9b38a0f8c97564643324ee99b9c86e7 Use text colours from the GTK+ theme instead of black when no buddy list theme is set. Should make things work better with dark themes diff -r 09f4d4bca9b3 -r 36f6f798e48a pidgin/gtkblist.c --- a/pidgin/gtkblist.c Tue Mar 03 20:53:14 2009 +0000 +++ b/pidgin/gtkblist.c Tue Mar 03 22:56:19 2009 +0000 @@ -3996,7 +3996,7 @@ } else if (!purple_presence_is_online(presence)) { if (theme) pair = pidgin_blist_theme_get_offline_text_info(theme); - name_color = (pair != NULL && pair->color != NULL) ? pair->color : "black"; + name_color = (pair != NULL && pair->color != NULL) ? pair->color : NULL; name_font = (pair != NULL && pair->font != NULL) ? pair->font : ""; if (theme) @@ -4007,7 +4007,7 @@ } else if (purple_presence_is_available(presence)) { if (theme) pair = pidgin_blist_theme_get_online_text_info(theme); - name_color = (pair != NULL && pair->color != NULL) ? pair->color : "black"; + name_color = (pair != NULL && pair->color != NULL) ? pair->color : NULL; name_font = (pair != NULL && pair->font != NULL) ? pair->font : ""; if (theme) @@ -4018,7 +4018,7 @@ } else { if (theme) pair = pidgin_blist_theme_get_away_text_info(theme); - name_color = (pair != NULL && pair->color != NULL) ? pair->color : "black"; + name_color = (pair != NULL && pair->color != NULL) ? pair->color : NULL; name_font = (pair != NULL && pair->font != NULL) ? pair->font : ""; if (theme) @@ -4028,23 +4028,49 @@ } if (aliased && selected) { - name_color = "black"; - status_color = "black"; + if (theme) { + name_color = "black"; + status_color = "black"; + } else { + name_color = NULL; + status_color = NULL; + } } /* Put it all together */ if (aliased && biglist && (statustext || idletime)) { /* using breaks the status, so it must be seperated into */ - text = g_strdup_printf("%s\n" - "%s%s%s", - name_font, name_color, nametext, status_font, status_color, - idletime != NULL ? idletime : "", - (idletime != NULL && statustext != NULL) ? " - " : "", - statustext != NULL ? statustext : ""); - - } else - text = g_strdup_printf("%s", name_font, name_color, nametext); - + if (name_color) { + text = g_strdup_printf("%s\n" + "%s%s%s", + name_font, name_color, nametext, status_font, status_color, + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); + } else if (status_color) { + text = g_strdup_printf("%s\n" + "%s%s%s", + name_font, nametext, status_font, status_color, + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); + } else { + text = g_strdup_printf("%s\n" + "%s%s%s", + name_font, nametext, status_font, + idletime != NULL ? idletime : "", + (idletime != NULL && statustext != NULL) ? " - " : "", + statustext != NULL ? statustext : ""); + } + } else { + if (name_color) { + text = g_strdup_printf("%s", + name_font, name_color, nametext); + } else { + text = g_strdup_printf("%s", name_font, + nametext); + } + } g_free(nametext); g_free(statustext); g_free(idletime); @@ -6159,12 +6185,17 @@ pair = pidgin_blist_theme_get_collapsed_text_info(theme); - text_color = (selected || pair == NULL || pair->color == NULL) ? "black" : pair->color; + text_color = (selected || pair == NULL || pair->color == NULL) ? NULL : pair->color; text_font = (pair == NULL || pair->font == NULL) ? "" : pair->font; esc = g_markup_escape_text(group->name, -1); - mark = g_strdup_printf("%s%s", + if (text_color) { + mark = g_strdup_printf("%s%s", text_color, text_font, esc ? esc : "", group_count); + } else { + mark = g_strdup_printf("%s%s", + text_font, esc ? esc : "", group_count); + } g_free(esc); return mark; @@ -6225,10 +6256,17 @@ if (!selected && theme != NULL && (pair = pidgin_blist_theme_get_idle_text_info(theme)) != NULL && pair->color != NULL) textcolor = pair->color; else - textcolor = "black"; - - idle = g_strdup_printf("%d:%02d", textcolor, - (pair == NULL || pair->font == NULL) ? "" : pair->font, ihrs, imin); + textcolor = NULL; + + if (textcolor) { + idle = g_strdup_printf("%d:%02d", + textcolor, (pair == NULL || pair->font == NULL) ? "" : pair->font, + ihrs, imin); + } else { + idle = g_strdup_printf("%d:%02d", + (pair == NULL || pair->font == NULL) ? "" : pair->font, + ihrs, imin); + } } } @@ -6325,10 +6363,15 @@ } font = (pair == NULL || pair->font == NULL) ? "" : pair->font; - fg_color = (selected || pair == NULL || pair->color == NULL) ? "black" : pair->color; - - tmp = g_strdup_printf("%s", + fg_color = (selected || pair == NULL || pair->color == NULL) ? NULL : pair->color; + + if (fg_color) { + tmp = g_strdup_printf("%s", font, fg_color, mark); + } else { + tmp = g_strdup_printf("%s", font, + mark); + } g_free(mark); mark = tmp; @@ -6458,13 +6501,17 @@ font = (pair == NULL || pair->font == NULL) ? "" : pair->font; if (selected || pair == NULL || pair->color == NULL) /* nick_said color is the same as gtkconv:tab-label-attention */ - color = (nick_said ? "#006aff" : "black"); + color = (nick_said ? "#006aff" : NULL); else color = pair->color; - tmp = g_strdup_printf("%s", - font, color, hidden ? "bold" : "normal", mark); - + if (color) { + tmp = g_strdup_printf("%s", + font, color, hidden ? "bold" : "normal", mark); + } else { + tmp = g_strdup_printf("%s", + font, hidden ? "bold" : "normal", mark); + } g_free(mark); mark = tmp;