diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-06-14 10:25:25 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-06-14 10:25:25 +0000 |
commit | 4d7b3e143cb4453dff44f02278ff67441bc929cc (patch) | |
tree | 57982a0138e6207aaddbedcd5e8b52a168264ee3 /src/textview.c | |
parent | 7ff335b88d10f3f162847faae079069b2780b0a0 (diff) |
fixed slightly wrong scroll position of the text view when the displayed message changed.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@342 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/textview.c')
-rw-r--r-- | src/textview.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/textview.c b/src/textview.c index c476b215..d547e06d 100644 --- a/src/textview.c +++ b/src/textview.c @@ -391,10 +391,16 @@ void textview_reflect_prefs(TextView *textview) void textview_show_message(TextView *textview, MimeInfo *mimeinfo, const gchar *file) { + GtkTextView *text = GTK_TEXT_VIEW(textview->text); + GtkTextBuffer *buffer; + GtkTextMark *mark; + GtkTextIter iter; FILE *fp; const gchar *charset = NULL; GPtrArray *headers = NULL; + buffer = gtk_text_view_get_buffer(text); + if ((fp = fopen(file, "rb")) == NULL) { FILE_OP_ERROR(file, "fopen"); return; @@ -413,14 +419,9 @@ void textview_show_message(TextView *textview, MimeInfo *mimeinfo, if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0) perror("fseek"); headers = textview_scan_header(textview, fp, charset); if (headers) { - GtkTextView *text = GTK_TEXT_VIEW(textview->text); - GtkTextBuffer *buffer; - GtkTextIter iter; - textview_show_header(textview, headers); procheader_header_array_destroy(headers); - buffer = gtk_text_view_get_buffer(text); gtk_text_buffer_get_end_iter(buffer, &iter); textview->body_pos = gtk_text_iter_get_offset(&iter); } @@ -430,6 +431,8 @@ void textview_show_message(TextView *textview, MimeInfo *mimeinfo, fclose(fp); textview_set_position(textview, 0); + mark = gtk_text_buffer_get_insert(buffer); + gtk_text_view_scroll_mark_onscreen(text, mark); } void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp) |