highlight queue if there are msgs in its sub-folders and the tree is collapsed
authorPaul <paul@claws-mail.org>
Sun, 29 Jun 2014 11:59:25 +0000 (12:59 +0100)
committerPaul <paul@claws-mail.org>
Sun, 29 Jun 2014 11:59:25 +0000 (12:59 +0100)
as is done for the parent queue folder

src/folderview.c

index 2ce7f9c36e420d5f254a7a108682f60ce8f40daf..d9d3a754f0e5a8138f905701648bb306ddb8c444 100644 (file)
@@ -1189,6 +1189,43 @@ void folderview_check_new_all(void)
        inc_unlock();
 }
 
+static gboolean folderview_have_children_sub(FolderView *folderview,
+                                            FolderItem *item,
+                                            gboolean in_sub)
+{
+       GNode *node = NULL;
+       
+       if (!item || !item->folder || !item->folder->node)
+               return FALSE;
+               
+       node = item->folder->node;
+       
+       node = g_node_find(node, G_PRE_ORDER, G_TRAVERSE_ALL, item);
+       node = node->children;
+
+       if (in_sub && item->total_msgs > 0) {
+               return TRUE;
+       }
+
+       while (node != NULL) {
+               if (node && node->data) {
+                       FolderItem *next_item = (FolderItem*) node->data;
+                       node = node->next;
+                       if (folderview_have_children_sub(folderview, 
+                                                        next_item, TRUE))
+                               return TRUE;
+               }
+       }
+
+       return FALSE;
+}
+
+static gboolean folderview_have_children(FolderView *folderview,
+                                        FolderItem *item)
+{
+       return folderview_have_children_sub(folderview, item, FALSE);
+}
+
 static gboolean folderview_have_new_children_sub(FolderView *folderview,
                                                 FolderItem *item,
                                                 gboolean in_sub)
@@ -1540,6 +1577,10 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
                                break;
                        }
                }
+               if (!GTK_CMCTREE_ROW(node)->expanded &&
+                   use_bold == FALSE &&
+                   folderview_have_children(folderview, item))
+                       use_bold = use_color = TRUE;
                procmsg_msg_list_free(list);
        } else {
                /* if unread messages exist, print with bold font */