[anjal] Fix scrolliing/position and conversation load chain of messages.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Fix scrolliing/position and conversation load chain of messages.
- Date: Tue, 23 Jun 2009 13:04:10 -0400 (EDT)
commit 8e32beae339d870c4c0f55e4895542a368634d0c
Author: Srinivasa Ragavan <sragavan novell com>
Date: Tue Jun 23 22:34:43 2009 +0530
Fix scrolliing/position and conversation load chain of messages.
src/mail-conv-view.c | 24 +++++++++++++++++-------
src/mail-message-view.c | 20 ++++++++++++--------
2 files changed, 29 insertions(+), 15 deletions(-)
---
diff --git a/src/mail-conv-view.c b/src/mail-conv-view.c
index f94b262..1026594 100644
--- a/src/mail-conv-view.c
+++ b/src/mail-conv-view.c
@@ -45,6 +45,7 @@ struct _MailConvViewPrivate {
MailMessageView **load_chain;
gint position;
gboolean once;
+ MailMessageView *last_child;
};
static void
@@ -329,7 +330,10 @@ mcv_message_reply (MailMessageView *mmv, MailConvView *mcv)
{
int x, y, ret;
GtkAdjustment *adj = gtk_viewport_get_vadjustment((GtkViewport *)mcv->priv->viewport);
+ GtkWidget *focus = mail_message_view_get_focus_widget (mmv);
+ if (!(mcv->priv->selected_child && mcv->priv->selected_child->data == focus))
+ return;
ret = gtk_widget_translate_coordinates (mail_message_view_get_focus_widget (mmv), mmv->comp_view, 0, 0, &x, &y);
gtk_adjustment_clamp_page (adj, y, y+((GtkWidget *)mmv)->allocation.height);
gtk_adjustment_set_value (adj, y+((GtkWidget *)mmv)->allocation.height);
@@ -340,7 +344,7 @@ render_msg (MailConvView *mcv)
{
MailMessageView *child = mcv->priv->load_chain[mcv->priv->position];
- mail_message_view_show_message ((MailMessageView *)child, FALSE);
+ mail_message_view_show_message ((MailMessageView *)child, child == mcv->priv->last_child);
return FALSE;
}
static void
@@ -402,20 +406,26 @@ mail_conv_view_set_thread (MailConvView *mcv, CamelFolder *folder, GPtrArray *ar
j++;
}
if (!unread) {
- if (mail_message_view_get_unread ((MailMessageView *)child))
+ if (mail_message_view_get_unread ((MailMessageView *)child)) {
unread = mail_message_view_get_focus_widget((MailMessageView *)child);
- g_signal_connect (child, "message-loaded", G_CALLBACK(mcv_scroll_to_mmv), mcv);
+ g_signal_connect (child, "message-loaded", G_CALLBACK(mcv_scroll_to_mmv), mcv);
+ }
}
if (i == array->len -1) {
+ mcv->priv->last_child = (MailMessageView *)child;
if (!unread) {
unread = mail_message_view_get_focus_widget((MailMessageView *)child);
g_signal_connect (child, "message-loaded", G_CALLBACK(mcv_scroll_to_mmv), mcv);
last_mail_shown = TRUE;
+ mail_message_view_show_message ((MailMessageView *)child, TRUE);
+ } else {
+ if (!mail_message_view_get_unread ((MailMessageView *)child)) {
+ mcv->priv->load_chain[j] = (MailMessageView *)child;
+ j++;
+ }
+ mcv->priv->load_chain[j] = NULL;
}
- if (j>0)
- mcv->priv->load_chain[j-1] = NULL;
- mail_message_view_show_message ((MailMessageView *)child, TRUE);
}
}
@@ -436,7 +446,7 @@ mail_conv_view_set_thread (MailConvView *mcv, CamelFolder *folder, GPtrArray *ar
g_signal_emit (mcv, signals[MESSAGE_SHOWN], 0);
/* Start showing the message */
- if (!last_mail_shown && j > 1) {
+ if (!last_mail_shown) {
mcv->priv->position = 0;
g_signal_connect (mcv->priv->load_chain[mcv->priv->position], "message-rendered", G_CALLBACK(mcv_msg_load_chain), mcv);
mail_message_view_show_message ((MailMessageView *)mcv->priv->load_chain[mcv->priv->position], FALSE);
diff --git a/src/mail-message-view.c b/src/mail-message-view.c
index d459c53..5e2f6c3 100644
--- a/src/mail-message-view.c
+++ b/src/mail-message-view.c
@@ -205,10 +205,10 @@ mmv_message_opened(CamelFolder *folder, const char *uid, CamelMimeMessage *msg,
gdk_window_invalidate_rect (((GtkWidget *)shell)->window, NULL, TRUE);
gtk_widget_queue_draw ((GtkWidget *)shell);
- if (shell->priv->show_composer) {
- construct_reply_composer (shell, REPLY_MODE_ALL);
- shell->priv->show_composer = FALSE;
- }
+ //if (shell->priv->show_composer) {
+ // construct_reply_composer (shell, REPLY_MODE_ALL);
+ // shell->priv->show_composer = FALSE;
+ //}
}
static void
@@ -252,10 +252,10 @@ mmv_show (MailMessageView *mmv)
gtk_widget_show(mmv->priv->spinner);
mmv->priv->cancel = mail_get_messagex(mmv->priv->folder, mmv->priv->uid, mmv_message_opened, mmv, mail_msg_fast_ordered_push);
} else {
- if (mmv->priv->show_composer) {
- construct_reply_composer (mmv, REPLY_MODE_ALL);
- mmv->priv->show_composer = FALSE;
- }
+ //if (mmv->priv->show_composer && 0) {
+ // construct_reply_composer (mmv, REPLY_MODE_ALL);
+ // mmv->priv->show_composer = FALSE;
+ // }
}
gtk_widget_show (mmv->body);
gtk_widget_show_all (mmv->footer);
@@ -629,6 +629,10 @@ mmv_finished_loading_webkit (WebKitWebView *webkitwebview, WebKitWebFrame *arg1
gtk_widget_queue_draw ((GtkWidget *)mmview);
g_signal_emit (mmview, signals[MESSAGE_RENDERED], 0);
+ if (mmview->priv->show_composer) {
+ construct_reply_composer (mmview, REPLY_MODE_ALL);
+ mmview->priv->show_composer = FALSE;
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]