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 | |
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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/textview.c | 13 |
3 files changed, 18 insertions, 5 deletions
@@ -1,5 +1,10 @@ 2005-06-14 + * src/textview.c: fixed slightly wrong scroll position when the + displayed message changed. + +2005-06-14 + * src/compose.c: scroll the view to the cursor position after paste. 2005-06-14 diff --git a/ChangeLog.ja b/ChangeLog.ja index d20029f6..4b16c106 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-06-14 + * src/textview.c: 表示されているメッセージが変更されたときにスクロール + 位置が微妙におかしかったのを修正。 + +2005-06-14 + * src/compose.c: ペーストの後ビューをカーソル位置までスクロール するようにした。 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) |