diff options
author | Milan Crha <mcrha@redhat.com> | 2009-07-15 02:03:52 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-07-15 02:03:52 +0800 |
commit | 563a1642a506f1086d6ad3313134b2f85143779a (patch) | |
tree | 59fe8b7a7351620b86267061c8fd399eb03df07f | |
parent | c6f885efd9b5c58efd030a6052c235deb21880fa (diff) | |
download | gsoc2013-evolution-563a1642a506f1086d6ad3313134b2f85143779a.tar.gz gsoc2013-evolution-563a1642a506f1086d6ad3313134b2f85143779a.tar.zst gsoc2013-evolution-563a1642a506f1086d6ad3313134b2f85143779a.zip |
Bug #214238 - Indicate unread emails in closed tree subfolders
-rw-r--r-- | mail/em-folder-tree.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index cf9fb8a4e0..0b14f41051 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -277,7 +277,7 @@ static void render_display_name (GtkTreeViewColumn *column, GtkCellRenderer *renderer, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data) { - gboolean is_store, bold; + gboolean is_store, bold, subdirs_unread = FALSE; guint unread; gchar *display; gchar *name; @@ -286,18 +286,29 @@ render_display_name (GtkTreeViewColumn *column, GtkCellRenderer *renderer, COL_BOOL_IS_STORE, &is_store, COL_UINT_UNREAD, &unread, -1); - if (!(bold = is_store || unread)) { - if (gtk_tree_model_iter_has_child (model, iter)) - bold = subdirs_contain_unread (model, iter); + bold = is_store || unread; + + if (gtk_tree_model_iter_has_child (model, iter)) { + gboolean expanded = TRUE; + + g_object_get (renderer, "is-expanded", &expanded, NULL); + + if (!bold || !expanded) + subdirs_unread = subdirs_contain_unread (model, iter); } + bold = bold || subdirs_unread; + if (!is_store && unread) { /* Translators: This is the string used for displaying the - * folder names in folder trees. "%s" will be replaced by - * the folder's name and "%u" will be replaced with the - * number of unread messages in the folder. + * folder names in folder trees. The first "%s" will be + * replaced by the folder's name and "%u" will be replaced + * with the number of unread messages in the folder. The + * second %s will be replaced with a "+" letter for collapsed + * folders with unread messages in some subfolder too, + * or with an empty string for other cases. * - * Most languages should translate this as "%s (%u)". The + * Most languages should translate this as "%s (%u%s)". The * languages that use localized digits (like Persian) may * need to replace "%u" with "%Iu". Right-to-left languages * (like Arabic and Hebrew) may need to add bidirectional @@ -307,7 +318,7 @@ render_display_name (GtkTreeViewColumn *column, GtkCellRenderer *renderer, * Do not translate the "folder-display|" part. Remove it * from your translation. */ - display = g_strdup_printf (C_("folder-display", "%s (%u)"), name, unread); + display = g_strdup_printf (C_("folder-display", "%s (%u%s)"), name, unread, subdirs_unread ? "+" : ""); g_free (name); } else display = name; |