+2001-08-21 [paul]
+
+ clean up after sync with sylpheed 0.5.3 release
+
+ * src/account.c, src/mainwindow.c
+ replace folderview_update_all() with
+ folderview_update_all_node()
+
+ * src/folderview.c
+ remove folderview_update_all()
+ fix re-introduced font mess, see Christoph's
+ entry 2001-06-24
+
+ * src/summaryview.c
+ remove prev_msgnum
+ use sylpheed's small font instead of
+ gtk default font for summary view
+
+
2001-08-17 [paul]
* configure.in
ac_prefs->folder && strcmp(ac_name, ac_prefs->account_name) != 0) {
folder_set_name(FOLDER(ac_prefs->folder),
ac_prefs->account_name);
- folderview_update_all();
+ folderview_update_all_node();
}
account_clist_set();
ac_prefs = gtk_clist_get_row_data(clist, row);
if (ac_prefs->folder) {
folder_destroy(FOLDER(ac_prefs->folder));
- folderview_update_all();
+ folderview_update_all_node();
}
account_destroy(ac_prefs);
account_clist_set();
static GdkFont *normalfont;
static GdkFont *boldfont;
+static GtkStyle *normal_style;
+static GtkStyle *normal_color_style;
static GtkStyle *bold_style;
static GtkStyle *bold_color_style;
bold_color_style = gtk_style_copy(bold_style);
bold_color_style->fg[GTK_STATE_NORMAL] = folderview->color_new;
}
+ if (!normal_style) {
+ normal_style = gtk_style_copy(gtk_widget_get_style(ctree));
+ normal_style->font = normalfont;
+ normal_color_style = gtk_style_copy(normal_style);
+ normal_color_style->fg[GTK_STATE_NORMAL] = folderview->color_new;
+ }
+
}
void folderview_set(FolderView *folderview)
gtk_widget_destroy(window);
}
-void folderview_update_all(void)
-{
- GList *list;
- GtkWidget *window;
-
- window = label_window_create(_("Updating all folders..."));
-
- list = folder_get_list();
- for (; list != NULL; list = list->next) {
- Folder *folder = list->data;
-
- if (!folder->scan_tree) continue;
- folder_set_ui_func(folder, folderview_scan_tree_func, NULL);
- folder->scan_tree(folder);
- folder_set_ui_func(folder, NULL, NULL);
- }
-
- folder_write_list();
- folderview_set_all();
- gtk_widget_destroy(window);
-}
-
void folderview_update_all_node(void)
{
GList *list;
static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
{
GtkCTree *ctree = GTK_CTREE(folderview->ctree);
- GtkStyle *style, *prev_style, *ctree_style;
+ GtkStyle *style = NULL;
GtkCTreeNode *parent;
FolderItem *item;
GdkPixmap *xpm, *openxpm;
gtk_ctree_node_set_text(ctree, node, COL_TOTAL, itos(item->total));
}
- ctree_style = gtk_widget_get_style(GTK_WIDGET(ctree));
- prev_style = gtk_ctree_node_get_row_style(ctree, node);
- if (!prev_style)
- prev_style = ctree_style;
- style = gtk_style_copy(prev_style);
- if (!style) return;
+ if (item->stype == F_TRASH) return;
if (item->stype == F_QUEUE) {
/* highlight queue folder if there are any messages */
use_bold = use_color = (item->total > 0);
- } else if (item->stype == F_TRASH) {
- /* Never highlight trash */
- use_bold = FALSE;
- use_color = FALSE;
} else {
/* if unread messages exist, print with bold font */
use_bold = (item->unread > 0) || add_unread_mark;
folderview_have_new_children(folderview, node));
}
- if (use_bold && boldfont)
- style->font = boldfont;
- else
- style->font = normalfont;
+ gtk_ctree_node_set_foreground(ctree, node, NULL);
- if (use_color) {
- style->fg[GTK_STATE_NORMAL] = folderview->color_new;
- style->fg[GTK_STATE_SELECTED] = folderview->color_new;
- } else {
+ if (use_bold && use_color)
+ style = bold_color_style;
+ else if (use_bold) {
+ style = bold_style;
if (item->op_count > 0) {
- if (boldfont)
- style->font = boldfont;
- style->fg[GTK_STATE_NORMAL] =
- folderview->color_op;
- style->fg[GTK_STATE_SELECTED] =
- folderview->color_op;
+ gtk_ctree_node_set_foreground(ctree, node,
+ &folderview->color_op);
} else {
- style->fg[GTK_STATE_NORMAL] =
- ctree_style->fg[GTK_STATE_NORMAL];
- style->fg[GTK_STATE_SELECTED] =
- ctree_style->fg[GTK_STATE_SELECTED];
+ style = bold_style;
}
}
+ else if (use_color) {
+ style = normal_color_style;
+ gtk_ctree_node_set_foreground(ctree, node,
+ &folderview->color_new);
+ }
+ else if (item->op_count > 0) {
+ style = normal_color_style;
+ gtk_ctree_node_set_foreground(ctree, node,
+ &folderview->color_op);
+ } else {
+ style = normal_style;
+ }
gtk_ctree_node_set_row_style(ctree, node, style);
GtkWidget *widget)
{
summary_show(mainwin->summaryview, NULL, FALSE);
- folderview_update_all();
+ folderview_update_all_node();
}
static void new_folder_cb(MainWindow *mainwin, guint action,
static GtkStyle *bold_style;
static GtkStyle *bold_marked_style;
static GtkStyle *bold_deleted_style;
+static GtkStyle *small_style;
+static GtkStyle *small_marked_style;
+static GtkStyle *small_deleted_style;
static GdkPixmap *folderxpm;
static GdkBitmap *folderxpmmask;
S_COL_MIME, pixmap);
gtk_widget_show(pixmap);
+ if (!small_style) {
+ small_style = gtk_style_copy
+ (gtk_widget_get_style(summaryview->ctree));
+ if (!smallfont)
+ smallfont = gdk_fontset_load(SMALL_FONT);
+ small_style->font = smallfont;
+ small_marked_style = gtk_style_copy(small_style);
+ small_marked_style->fg[GTK_STATE_NORMAL] =
+ summaryview->color_marked;
+ small_deleted_style = gtk_style_copy(small_style);
+ small_deleted_style->fg[GTK_STATE_NORMAL] =
+ summaryview->color_dim;
+ }
if (!bold_style) {
bold_style = gtk_style_copy
(gtk_widget_get_style(summaryview->ctree));
if (!boldfont)
- boldfont = gdk_fontset_load(prefs_common.boldfont);
+ boldfont = gdk_fontset_load(BOLD_FONT);
bold_style->font = boldfont;
bold_marked_style = gtk_style_copy(bold_style);
bold_marked_style->fg[GTK_STATE_NORMAL] =
summaryview->color_dim;
}
- if (!smallfont)
- smallfont = gdk_fontset_load(SMALL_FONT);
+ /* if (!smallfont)
+ smallfont = gdk_fontset_load(SMALL_FONT);*/
+
+ if (!small_style) {
+ small_style = gtk_style_copy
+ (gtk_widget_get_style(summaryview->ctree));
+ if (!smallfont)
+ smallfont = gdk_fontset_load(SMALL_FONT);
+ small_style->font = smallfont;
+ small_marked_style = gtk_style_copy(small_style);
+ small_marked_style->fg[GTK_STATE_NORMAL] =
+ summaryview->color_marked;
+ small_deleted_style = gtk_style_copy(small_style);
+ small_deleted_style->fg[GTK_STATE_NORMAL] =
+ summaryview->color_dim;
+ }
style = gtk_style_copy(gtk_widget_get_style
(summaryview->statlabel_folder));
- if (smallfont) style->font = smallfont;
+ /* if (smallfont) style->font = smallfont;*/
+
gtk_widget_set_style(summaryview->statlabel_folder, style);
gtk_widget_set_style(summaryview->statlabel_select, style);
gtk_widget_set_style(summaryview->statlabel_msgs, style);
GSList *mlist = NULL;
gchar *buf;
gboolean is_refresh;
- guint prev_msgnum = 0;
guint selected_msgnum = 0;
guint displayed_msgnum = 0;
summary_write_cache(summaryview);
else
return FALSE;
+ folder_update_op_count();
}
else if (!summaryview->filtering_happened) {
summary_write_cache(summaryview);
deletedxpm, deletedxpmmask);
if (style)
style = bold_deleted_style;
- else
+ else {
+ style = small_deleted_style;
+ }
gtk_ctree_node_set_foreground
(ctree, row, &summaryview->color_dim);
} else if (MSG_IS_MARKED(flags)) {
- gtk_ctree_node_set_pixmap(ctree, row, S_COL_MARK,
+ gtk_ctree_node_set_pixmap(ctree, row, S_COL_MARK,
markxpm, markxpmmask);
} else if (MSG_IS_MOVE(flags)) {
gtk_ctree_node_set_text(ctree, row, S_COL_MARK, "o");
if (style)
style = bold_marked_style;
- else
+ else {
+ style = small_marked_style;
+ }
gtk_ctree_node_set_foreground
(ctree, row, &summaryview->color_marked);
} else if (MSG_IS_COPY(flags)) {
gtk_ctree_node_set_text(ctree, row, S_COL_MARK, "O");
if (style)
style = bold_marked_style;
- else
- gtk_ctree_node_set_foreground(ctree, row,
- &summaryview->color_marked);
+ else {
+ style = small_marked_style;
+ }
+ gtk_ctree_node_set_foreground
+ (ctree, row, &summaryview->color_marked);
}
else if ((global_scoring ||
summaryview->folder_item->prefs->scoring) &&
} else {
gtk_ctree_node_set_text(ctree, row, S_COL_MIME, NULL);
}
+ if (!style)
+ style = small_style;
gtk_ctree_node_set_row_style(ctree, row, style);
}