[evolution] Bug #214238 - Indicate unread emails in closed tree subfolders
- From: Milan Crha <mcrha src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution] Bug #214238 - Indicate unread emails in closed tree subfolders
- Date: Tue, 14 Jul 2009 18:03:53 +0000 (UTC)
commit 563a1642a506f1086d6ad3313134b2f85143779a
Author: Milan Crha <mcrha redhat com>
Date: Tue Jul 14 20:03:52 2009 +0200
Bug #214238 - Indicate unread emails in closed tree subfolders
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 cf9fb8a..0b14f41 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]