aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-10-31 04:12:48 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-10-31 04:12:48 +0000
commit237bf32a6f490c973a5ba3da606fbcf7fce5f790 (patch)
tree16c9a99a2ead69a91cc612cb24b809a510d5dce8
parent5a18906d322c9fe8301f1b395b01793a6a5d7148 (diff)
fixed scroll jumping on focus of textview in mimeview.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@697 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog4
-rw-r--r--ChangeLog.ja5
-rw-r--r--src/textview.c16
3 files changed, 19 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d95b403..e543e82a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)