#include <tny-folder-monitor.h>
#include <tny-folder-change.h>
#include <tny-error.h>
+#include <tny-merge-folder.h>
#include <string.h>
#include <modest-header-view.h>
GtkCellRenderer *renderer_subject;
GtkCellRenderer *renderer_address;
GtkCellRenderer *renderer_date_status;
+
+ GdkColor active_color;
+ GdkColor secondary_color;
};
typedef struct _HeadersCountChangedHelper HeadersCountChangedHelper;
/* Create sortable model */
sortable = gtk_tree_model_sort_new_with_model (filter_model);
+ g_object_unref (filter_model);
/* install our special sorting functions */
cursor = cols = gtk_tree_view_get_columns (GTK_TREE_VIEW(self));
if (priv->folder) {
TnyAccount *my_account;
- my_account = tny_folder_get_account (priv->folder);
- if (my_account == account)
- modest_header_view_clear (MODEST_HEADER_VIEW (user_data));
- g_object_unref (my_account);
+ if (TNY_IS_MERGE_FOLDER (priv->folder) &&
+ tny_folder_get_folder_type (priv->folder) == TNY_FOLDER_TYPE_OUTBOX) {
+ ModestTnyAccountStore *acc_store = modest_runtime_get_account_store ();
+ my_account = modest_tny_account_store_get_local_folders_account (acc_store);
+ } else {
+ my_account = tny_folder_get_account (priv->folder);
+ }
+
+ if (my_account) {
+ if (my_account == account)
+ modest_header_view_clear (MODEST_HEADER_VIEW (user_data));
+ g_object_unref (my_account);
+ }
}
}
PangoAttrList *attr_list;
GtkStyle *style;
PangoAttribute *attr;
- GdkColor *new_color;
g_return_if_fail (MODEST_IS_HEADER_VIEW (self));
priv = MODEST_HEADER_VIEW_GET_PRIVATE (self);
if (!gtk_style_lookup_color (GTK_WIDGET (self)->style, "SecondaryTextColor", &style_color)) {
gdk_color_parse ("grey", &style_color);
}
+ priv->secondary_color = style_color;
attr = pango_attr_foreground_new (style_color.red, style_color.green, style_color.blue);
pango_attr_list_insert (attr_list, attr);
pango_attr_list_insert (attr_list, attr);
g_object_set (G_OBJECT (priv->renderer_address),
- "foreground-gdk", &style_color,
+ "foreground-gdk", priv->secondary_color,
"foreground-set", TRUE,
"attributes", attr_list,
NULL);
g_object_set (G_OBJECT (priv->renderer_date_status),
- "foreground-gdk", &style_color,
+ "foreground-gdk", priv->secondary_color,
"foreground-set", TRUE,
"attributes", attr_list,
NULL);
pango_attr_list_unref (attr_list);
} else {
g_object_set (G_OBJECT (priv->renderer_address),
- "foreground-gdk", &style_color,
+ "foreground-gdk", priv->secondary_color,
"foreground-set", TRUE,
"scale", PANGO_SCALE_SMALL,
"scale-set", TRUE,
NULL);
g_object_set (G_OBJECT (priv->renderer_date_status),
- "foreground-gdk", &style_color,
+ "foreground-gdk", priv->secondary_color,
"foreground-set", TRUE,
"scale", PANGO_SCALE_SMALL,
"scale-set", TRUE,
}
if (gtk_style_lookup_color (GTK_WIDGET (self)->style, "ActiveTextColor", &style_active_color)) {
- new_color = gdk_color_copy (&style_active_color);
+ priv->active_color = style_active_color;
+#ifdef MODEST_TOOLKIT_HILDON2
+ g_object_set_data (G_OBJECT (priv->renderer_subject), BOLD_IS_ACTIVE_COLOR, GINT_TO_POINTER (TRUE));
+ g_object_set_data_full (G_OBJECT (priv->renderer_subject), ACTIVE_COLOR, new_color, (GDestroyNotify) gdk_color_free);
+#endif
} else {
- new_color = NULL;
- }
#ifdef MODEST_TOOLKIT_HILDON2
- g_object_set_data (G_OBJECT (priv->renderer_subject), BOLD_IS_ACTIVE_COLOR, GINT_TO_POINTER (new_color != NULL));
- g_object_set_data_full (G_OBJECT (priv->renderer_subject), ACTIVE_COLOR, new_color, (GDestroyNotify) gdk_color_free);
+ g_object_set_data (G_OBJECT (priv->renderer_subject), BOLD_IS_ACTIVE_COLOR, GINT_TO_POINTER (FALSE));
#endif
+ }
}
TnyHeader *