diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/textview.c | 16 |
3 files changed, 19 insertions, 6 deletions
@@ -1,3 +1,7 @@ +2005-10-31 + + * src/textview.c: textview_show_part(): fixed scroll jumping on focus. + 2005-10-29 * version 2.1.5 diff --git a/ChangeLog.ja b/ChangeLog.ja index 48d6ebcd..48b95b2f 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2005-10-31 + + * src/textview.c: textview_show_part(): フォーカス時にスクロールが + ジャンプしてしまう問題を修正。 + 2005-10-29 * version 2.1.5 diff --git a/src/textview.c b/src/textview.c index 3fa4557c..5a742960 100644 --- a/src/textview.c +++ b/src/textview.c @@ -487,6 +487,10 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp) const gchar *charset = NULL; GPtrArray *headers = NULL; gboolean is_rfc822_part = FALSE; + GtkTextView *text = GTK_TEXT_VIEW(textview->text); + GtkTextBuffer *buffer; + GtkTextIter iter; + GtkTextMark *mark; g_return_if_fail(mimeinfo != NULL); g_return_if_fail(fp != NULL); @@ -555,18 +559,14 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp) } textview_set_font(textview, charset); - textview_clear(textview); - if (headers) { - GtkTextView *text = GTK_TEXT_VIEW(textview->text); - GtkTextBuffer *buffer; - GtkTextIter iter; + buffer = gtk_text_view_get_buffer(text); + if (headers) { 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); if (!mimeinfo->main) @@ -577,6 +577,10 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp) textview_add_parts(textview, mimeinfo, fp); else textview_write_body(textview, mimeinfo, fp, charset); + + textview_set_position(textview, 0); + mark = gtk_text_buffer_get_insert(buffer); + gtk_text_view_scroll_mark_onscreen(text, mark); } static void textview_add_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp) |