Mercurial > pidgin
changeset 14660:8617e34e30da
[gaim-migrate @ 17406]
It was discussed on gaim-devel a little while ago that having group counts on
collapsed groups might be a good idea, so here that is. It's not perfect,
there seem to be some redrawing issues here, the blist row doesn't get redrawn
until you select a different row, but I'm not sure that there's anything to do
about that (and even if there is I don't know what).
committer: Tailor Script <tailor@pidgin.im>
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Sat, 30 Sep 2006 03:08:47 +0000 |
parents | 897d2d09787e |
children | 477a2d0ad133 |
files | gtk/gtkblist.c |
diffstat | 1 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/gtk/gtkblist.c Sat Sep 30 03:02:01 2006 +0000 +++ b/gtk/gtkblist.c Sat Sep 30 03:08:47 2006 +0000 @@ -4385,10 +4385,11 @@ show = TRUE;} if (show) { + char group_count[12] = ""; char *mark, *esc; GtkTreeIter iter; GtkTreePath *path; - gboolean expanded; + gboolean expanded; GdkColor bgcolor; GdkColor textcolor; @@ -4402,13 +4403,19 @@ expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(gtkblist->treeview), path); gtk_tree_path_free(path); + if (!expanded) { + g_snprintf(group_count, sizeof(group_count), " (%d/%d)", + gaim_blist_get_group_online_count(group), + gaim_blist_get_group_size(group, FALSE)); + } + esc = g_markup_escape_text(group->name, -1); if (selected) - mark = g_strdup_printf("<span weight='bold'>%s</span>",esc); + mark = g_strdup_printf("<span weight='bold'>%s</span>%s", esc, group_count); else - mark = g_strdup_printf("<span color='#%02x%02x%02x' weight='bold'>%s</span>", + mark = g_strdup_printf("<span color='#%02x%02x%02x' weight='bold'>%s</span>%s", textcolor.red>>8, textcolor.green>>8, textcolor.blue>>8, - esc); + esc, group_count); g_free(esc);