GtkCellRenderer *messages_renderer;
GSList *signal_handlers;
- GdkColor *active_color;
+ GdkColor active_color;
};
#define MODEST_FOLDER_VIEW_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), \
if (item_name && item_weight) {
/* Set the name in the treeview cell: */
- if (priv->cell_style == MODEST_FOLDER_VIEW_CELL_STYLE_COMPACT && item_weight == 800 && priv->active_color) {
+ if (priv->cell_style == MODEST_FOLDER_VIEW_CELL_STYLE_COMPACT && item_weight == 800 &&
+ (priv->active_color.red != 0 || priv->active_color.blue != 0 || priv->active_color.green != 0)) {
g_object_set (rendobj,
"text", item_name,
"weight-set", FALSE,
"foreground-set", TRUE,
- "foreground-gdk", priv->active_color,
+ "foreground-gdk", &(priv->active_color),
NULL);
} else {
g_object_set (rendobj,
drafts = FALSE;
}
- if (priv->cell_style == MODEST_FOLDER_VIEW_CELL_STYLE_COMPACT) {
- if (number > 1) {
- item_name = g_strdup_printf (drafts?_("mcen_ti_messages"):_("mcen_va_new_messages"),
- number);
- } else if (number == 1) {
- item_name = g_strdup_printf (drafts?_("mcen_ti_message"):_("mcen_va_new_message"),
- number);
- }
- }
-
- }
+ if ((priv->cell_style == MODEST_FOLDER_VIEW_CELL_STYLE_COMPACT) && (number > 0)) {
+ item_name =
+ g_strdup_printf (ngettext ((drafts) ? "mcen_ti_message" : "mcen_va_new_message",
+ (drafts) ? "mcen_ti_messages" : "mcen_va_new_messages",
+ number), number);
+ }
+ }
if (!item_name)
item_name = g_strdup ("");
priv->messages_renderer = gtk_cell_renderer_text_new ();
g_object_set (priv->messages_renderer,
#ifdef MODEST_TOOLKIT_HILDON2
- "yalign", 0.0,
+ "yalign", 0.5,
"ypad", MODEST_MARGIN_DEFAULT,
"xpad", MODEST_MARGIN_DOUBLE,
#else
G_CALLBACK(on_configuration_key_changed),
obj);
- priv->active_color = NULL;
+ gdk_color_parse ("000", &priv->active_color);
update_style (obj);
priv->signal_handlers = modest_signal_mgr_connect (priv->signal_handlers,
priv = MODEST_FOLDER_VIEW_GET_PRIVATE(obj);
- if (priv->active_color) {
- gdk_color_free (priv->active_color);
- priv->active_color = NULL;
- }
-
if (priv->timer_expander != 0) {
g_source_remove (priv->timer_expander);
priv->timer_expander = 0;
/* Clear hidding array created by cut operation */
_clear_hidding_filter (MODEST_FOLDER_VIEW (obj));
+ gdk_color_parse ("000", &priv->active_color);
+
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
#ifdef MODEST_TOOLKIT_HILDON2
TnyGtkFolderListStoreFlags flags;
flags = TNY_GTK_FOLDER_LIST_STORE_FLAG_SHOW_PATH;
- if (!priv->do_refresh)
- flags &= TNY_GTK_FOLDER_LIST_STORE_FLAG_NO_REFRESH;
+ if (priv->do_refresh)
+ flags |= TNY_GTK_FOLDER_LIST_STORE_FLAG_DELAYED_REFRESH;
+ else
+ flags |= TNY_GTK_FOLDER_LIST_STORE_FLAG_NO_REFRESH;
model = tny_gtk_folder_list_store_new_with_flags (NULL,
flags);
tny_gtk_folder_list_store_set_path_separator (TNY_GTK_FOLDER_LIST_STORE (model),
NULL);
pango_attr_list_unref (attr_list);
}
- if (priv->active_color)
- gdk_color_free (priv->active_color);
if (gtk_style_lookup_color (GTK_WIDGET (self)->style, "ActiveTextColor", &style_active_color)) {
- priv->active_color = gdk_color_copy (&style_active_color);
+ priv->active_color = style_active_color;
+ } else {
+ gdk_color_parse ("000", &(priv->active_color));
}
}