aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@gnome.org>2010-07-20 23:25:16 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-07-26 09:30:01 +0800
commit0d51f6658348f8a8c33326f5ad11dad76d6d1642 (patch)
treefcb4c62a9f4afb45e96b2f28f6ed3a5d26a9a60b /mail
parent6b263851cac1e88e0c59fe6424da6f2f5d13e9f5 (diff)
downloadgsoc2013-evolution-0d51f6658348f8a8c33326f5ad11dad76d6d1642.tar
gsoc2013-evolution-0d51f6658348f8a8c33326f5ad11dad76d6d1642.tar.gz
gsoc2013-evolution-0d51f6658348f8a8c33326f5ad11dad76d6d1642.tar.bz2
gsoc2013-evolution-0d51f6658348f8a8c33326f5ad11dad76d6d1642.tar.lz
gsoc2013-evolution-0d51f6658348f8a8c33326f5ad11dad76d6d1642.tar.xz
gsoc2013-evolution-0d51f6658348f8a8c33326f5ad11dad76d6d1642.tar.zst
gsoc2013-evolution-0d51f6658348f8a8c33326f5ad11dad76d6d1642.zip
Make clutter mode even more appealing.
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-notebook-view.c39
-rw-r--r--mail/e-mail-paned-view.c20
-rw-r--r--mail/e-mail-reader.c27
-rw-r--r--mail/em-format-html.c7
-rw-r--r--mail/message-list.c7
5 files changed, 49 insertions, 51 deletions
diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c
index 34ebd1d7b7..d5f3109b74 100644
--- a/mail/e-mail-notebook-view.c
+++ b/mail/e-mail-notebook-view.c
@@ -71,37 +71,18 @@ static EMailViewClass *parent_class;
static GType mail_notebook_view_type;
#if HAVE_CLUTTER
-struct _anim_data {
- EMailNotebookView *view;
- int page;
-};
-
-static void
-start_tab_switch_cb (ClutterAnimation *animation,
- struct _anim_data *data)
-{
- gtk_notebook_set_current_page (data->view->priv->book, data->page);
- animation = clutter_actor_animate ((ClutterActor *)data->view->priv->actor, CLUTTER_EASE_IN_SINE, 150,
- "opacity", 255,
- NULL);
-
-}
-
-
static void
mnv_set_current_tab (EMailNotebookView *view,
int page)
{
ClutterAnimation *animation;
- struct _anim_data *data = g_new0 (struct _anim_data, 1);
-
- data->view = view;
- data->page = page;
- animation = clutter_actor_animate ((ClutterActor *)view->priv->actor, CLUTTER_EASE_OUT_SINE, 150,
- "opacity", 0,
+ clutter_actor_set_opacity (view->priv->actor, 0);
+ gtk_notebook_set_current_page (view->priv->book, page);
+ animation = clutter_actor_animate ((ClutterActor *)view->priv->actor, CLUTTER_EASE_IN_SINE, 500,
+ "opacity", 255,
NULL);
- g_signal_connect_after (animation, "completed", G_CALLBACK(start_tab_switch_cb), data);
+
}
#endif
@@ -153,7 +134,6 @@ mnv_page_changed (GtkNotebook *book, GtkNotebookPage *page,
EMFolderTree *tree;
const char *uri = e_mail_reader_get_folder_uri (E_MAIL_READER(mview));
-
g_object_get (sidebar, "folder-tree", &tree, NULL);
if (uri)
em_folder_tree_set_selected (tree, uri, FALSE);
@@ -744,6 +724,7 @@ mail_netbook_view_open_mail (EMailView *view, const char *uid, EMailNotebookView
EMailTab *tab;
ClutterActor *clone;
ClutterTimeline *timeline;
+ GtkWidget *mlist;
e_mail_tab_set_active (e_mail_tab_picker_get_tab (priv->tab_picker,
e_mail_tab_picker_get_current_tab (priv->tab_picker)),
@@ -766,10 +747,11 @@ mail_netbook_view_open_mail (EMailView *view, const char *uid, EMailNotebookView
camel_message_info_subject(info)));
#if HAVE_CLUTTER
+ mlist = e_mail_reader_get_message_list (E_MAIL_READER(pane));
mnv_set_current_tab (nview, page);
g_object_set_data ((GObject *)priv->current_view, "stage", priv->stage);
- g_object_set_data ((GObject *)preview, "stage", priv->stage);
- g_object_set_data ((GObject *)preview, "actor", priv->actor);
+ g_object_set_data ((GObject *)mlist, "stage", priv->stage);
+ g_object_set_data ((GObject *)mlist, "preview-actor", priv->actor);
#else
gtk_notebook_set_current_page (priv->book, page);
#endif
@@ -838,6 +820,9 @@ mail_notebook_view_set_folder (EMailReader *reader,
new_view = g_hash_table_lookup (priv->views, folder_uri);
if (new_view) {
int curr = emnv_get_page_num (E_MAIL_NOTEBOOK_VIEW (reader), new_view);
+
+ if (curr == e_mail_tab_picker_get_current_tab (priv->tab_picker))
+ return;
#if HAVE_CLUTTER
EMailTab *tab;
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index 57f0c00704..6733e40182 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -48,12 +48,6 @@
#include "message-list.h"
#include "e-mail-reader-utils.h"
-#if HAVE_CLUTTER
-#include <clutter/clutter.h>
-#include <mx/mx.h>
-#include <clutter-gtk/clutter-gtk.h>
-#endif
-
#define E_SHELL_WINDOW_ACTION_GROUP_MAIL(window) \
E_SHELL_WINDOW_ACTION_GROUP ((window), "mail")
@@ -184,9 +178,7 @@ mail_paned_view_message_selected_cb (EMailPanedView *view,
const gchar *folder_uri;
const gchar *key;
gchar *group_name;
-#if HAVE_CLUTTER
- ClutterActor *actor = g_object_get_data ((GObject *)view->priv->preview, "actor");
-#endif
+
folder_uri = message_list->folder_uri;
/* This also gets triggered when selecting a store name on
@@ -210,16 +202,6 @@ mail_paned_view_message_selected_cb (EMailPanedView *view,
g_free (group_name);
-#if HAVE_CLUTTER
- if (actor) {
- clutter_actor_set_opacity (actor, 0);
- clutter_actor_animate (actor, CLUTTER_EASE_OUT_SINE, 150,
- "opacity", 255,
- NULL);
- }
-
-#endif
-
}
static void
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 849695da78..40622ea695 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -53,6 +53,13 @@
#include "mail/mail-vfolder.h"
#include "mail/message-list.h"
+
+#if HAVE_CLUTTER
+#include <clutter/clutter.h>
+#include <mx/mx.h>
+#include <clutter-gtk/clutter-gtk.h>
+#endif
+
#define E_MAIL_READER_GET_PRIVATE(obj) \
((EMailReaderPrivate *) g_object_get_qdata \
(G_OBJECT (obj), quark_private))
@@ -672,13 +679,25 @@ action_mail_next_cb (GtkAction *action,
GtkWidget *message_list;
MessageListSelectDirection direction;
guint32 flags, mask;
-
+#if HAVE_CLUTTER
+ ClutterActor *actor;
+#endif
+
direction = MESSAGE_LIST_SELECT_NEXT;
flags = 0;
mask = 0;
message_list = e_mail_reader_get_message_list (reader);
+#if HAVE_CLUTTER
+ actor = g_object_get_data ((GObject *)message_list, "preview-actor");
+ if (actor) {
+ clutter_actor_set_opacity (actor, 0);
+ clutter_actor_animate (actor, CLUTTER_EASE_OUT_SINE, 500,
+ "opacity", 255,
+ NULL);
+ }
+#endif
message_list_select (
MESSAGE_LIST (message_list), direction, flags, mask);
}
@@ -2171,9 +2190,15 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
gboolean store_async;
MailMsgDispatchFunc disp_func;
+
string = g_strdup_printf (
_("Retrieving message '%s'"), cursor_uid);
+#if HAVE_CLUTTER
+ if (!e_shell_get_express_mode(e_shell_get_default()))
+ e_web_view_load_string (web_view, string);
+#else
e_web_view_load_string (web_view, string);
+#endif
g_free (string);
store_async = parent_store->flags & CAMEL_STORE_ASYNC;
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 361f7541fa..95e1572e7c 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -50,6 +50,8 @@
#include "e-util/e-extensible.h"
#include "misc/e-web-view.h"
+#include "shell/e-shell.h"
+
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-stream.h>
@@ -341,8 +343,11 @@ efh_format_timeout(struct _format_msg *m)
p->last_part = NULL;
} else {
efh->state = EM_FORMAT_HTML_STATE_RENDERING;
-
+#if HAVE_CLUTTER
+ if (p->last_part != m->message && !e_shell_get_express_mode(e_shell_get_default())) {
+#else
if (p->last_part != m->message) {
+#endif
hstream = gtk_html_begin (GTK_HTML (web_view));
gtk_html_stream_printf (hstream, "<h5>%s</h5>", _("Formatting Message..."));
gtk_html_stream_close (hstream, GTK_HTML_STREAM_OK);
diff --git a/mail/message-list.c b/mail/message-list.c
index f19754a1fe..96d2a68cbe 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -4198,8 +4198,9 @@ message_list_set_search (MessageList *ml, const gchar *search)
ml->thread_tree = NULL;
}
-#if HAVE_CLUTTER
- clutter_timeline_start (ml->priv->timeline);
+#if HAVE_CLUTTER
+ if (ml->priv->timeline)
+ clutter_timeline_start (ml->priv->timeline);
#endif
if (ml->frozen == 0)
@@ -4653,7 +4654,7 @@ regen_list_done (struct _regen_list_msg *m)
m->ml->priv->any_row_changed = FALSE;
#if HAVE_CLUTTER
- if (clutter_timeline_is_playing(m->ml->priv->timeline)) {
+ if (m->ml->priv->timeline && clutter_timeline_is_playing(m->ml->priv->timeline)) {
clutter_timeline_stop (m->ml->priv->timeline);
} else {
ClutterActor *pane = g_object_get_data ((GObject *)m->ml, "actor");