X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-folder-view.c;h=bd1673c980d9e82339e0aa054c9ab9d24028c34e;hp=e20acb5e1c96c9f96e793c66ea63a446bef53610;hb=2df4e39bc19eed85249fc613f47813719c1f0bfd;hpb=a3b26a8ec27a717e6a4c94824531b51e526281ba diff --git a/src/widgets/modest-folder-view.c b/src/widgets/modest-folder-view.c index e20acb5..bd1673c 100644 --- a/src/widgets/modest-folder-view.c +++ b/src/widgets/modest-folder-view.c @@ -256,6 +256,7 @@ struct _ModestFolderViewPrivate { gulong outbox_deleted_handler; guint activity_changed_handler; + GdkColor *active_color; }; #define MODEST_FOLDER_VIEW_GET_PRIVATE(o) \ (G_TYPE_INSTANCE_GET_PRIVATE((o), \ @@ -605,15 +606,13 @@ format_compact_style (gchar **item_name, buffer = g_string_append (buffer, *item_name); if (concat_folder_name) { - if (bold) buffer = g_string_append (buffer, ""); buffer = g_string_append (buffer, folder_name); - if (bold) buffer = g_string_append (buffer, ""); } g_free (*item_name); g_object_unref (account); *item_name = g_string_free (buffer, FALSE); - *use_markup = bold; + *use_markup = FALSE; } else { *use_markup = FALSE; } @@ -740,10 +739,21 @@ text_cell_data (GtkTreeViewColumn *column, if (item_name && item_weight) { /* Set the name in the treeview cell: */ - if (use_markup) - g_object_set (rendobj, "markup", item_name, "weight-set", FALSE, NULL); - else - g_object_set (rendobj, "text", item_name, "weight-set", TRUE, "weight", item_weight, NULL); + if (priv->cell_style == MODEST_FOLDER_VIEW_CELL_STYLE_COMPACT && item_weight == 800 && priv->active_color) { + g_object_set (rendobj, + "text", item_name, + "weight-set", FALSE, + "foreground-set", TRUE, + "foreground-gdk", priv->active_color, + NULL); + } else { + g_object_set (rendobj, + "text", item_name, + "foreground-set", FALSE, + "weight-set", TRUE, + "weight", item_weight, + NULL); + } /* Notify display name observers */ /* TODO: What listens for this signal, and how can it use only the new name? */ @@ -1310,6 +1320,8 @@ modest_folder_view_init (ModestFolderView *obj) G_CALLBACK(on_configuration_key_changed), obj); + priv->active_color = NULL; + update_style (obj); g_signal_connect (G_OBJECT (obj), "notify::style", G_CALLBACK (on_notify_style), (gpointer) obj); @@ -1335,6 +1347,11 @@ modest_folder_view_finalize (GObject *obj) 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; @@ -1368,6 +1385,19 @@ modest_folder_view_finalize (GObject *obj) priv->display_name_changed_signal = 0; } +#ifdef MODEST_TOOLKIT_HILDON2 + GtkTreeModel *tny_model; + + if (get_inner_models (MODEST_FOLDER_VIEW (obj), NULL, NULL, &tny_model)) { + if (g_signal_handler_is_connected (tny_model, + priv->activity_changed_handler)) { + g_signal_handler_disconnect (tny_model, + priv->activity_changed_handler); + priv->activity_changed_handler = 0; + } + } +#endif + if (priv->query) { g_object_unref (G_OBJECT (priv->query)); priv->query = NULL; @@ -3965,7 +3995,7 @@ static void update_style (ModestFolderView *self) { ModestFolderViewPrivate *priv; - GdkColor style_color; + GdkColor style_color, style_active_color; PangoAttrList *attr_list; GtkStyle *style; PangoAttribute *attr; @@ -3999,6 +4029,12 @@ update_style (ModestFolderView *self) 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); + } } static void