diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | src/textview.c | 20 |
4 files changed, 31 insertions, 1 deletions
@@ -1,5 +1,10 @@ 2005-10-20 + * src/textview.c: fixed a problem that the view was scrolled to top + when it got focus. + +2005-10-20 + * libsylph/utils.[ch]: set_startup_dir(), set_rc_dir(), get_startup_dir(): new. * src/main.[ch]: removed global variable startup_dir. Instead use diff --git a/ChangeLog.ja b/ChangeLog.ja index 6284c17d..56f07030 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,10 @@ 2005-10-20 + * src/textview.c: ビューがフォーカスを得たときに先頭にスクロールして + しまう問題を修正。 + +2005-10-20 + * libsylph/utils.[ch]: set_startup_dir(), set_rc_dir(), get_startup_dir(): 新規。 * src/main.[ch]: グローバル変数 startup_dir を削除。代わりに diff --git a/configure.in b/configure.in index 7c02cf41..376f6ec5 100644 --- a/configure.in +++ b/configure.in @@ -9,7 +9,7 @@ MINOR_VERSION=1 MICRO_VERSION=4 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION= +EXTRA_VERSION=+svn VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/textview.c b/src/textview.c index 43641078..9ee523a3 100644 --- a/src/textview.c +++ b/src/textview.c @@ -203,6 +203,9 @@ static void textview_popup_menu_activate_image_cb (GtkMenuItem *menuitem, gpointer data); +static void textview_adj_value_changed (GtkAdjustment *adj, + gpointer data); + static void textview_smooth_scroll_do (TextView *textview, gfloat old_value, gfloat last_value, @@ -282,6 +285,10 @@ TextView *textview_create(void) g_signal_connect(G_OBJECT(text), "populate-popup", G_CALLBACK(textview_populate_popup), textview); + g_signal_connect(G_OBJECT(GTK_TEXT_VIEW(text)->vadjustment), + "value-changed", + G_CALLBACK(textview_adj_value_changed), textview); + gtk_widget_show(scrolledwin); vbox = gtk_vbox_new(FALSE, 0); @@ -1484,11 +1491,17 @@ static void textview_smooth_scroll_do(TextView *textview, /* gdk_key_repeat_disable(); */ + g_signal_handlers_block_by_func(vadj, textview_adj_value_changed, + textview); + for (i = step; i <= change_value; i += step) { vadj->value = old_value + (up ? -i : i); g_signal_emit_by_name(G_OBJECT(vadj), "value_changed", 0); } + g_signal_handlers_unblock_by_func(vadj, textview_adj_value_changed, + textview); + vadj->value = last_value; g_signal_emit_by_name(G_OBJECT(vadj), "value_changed", 0); @@ -2044,6 +2057,13 @@ static void textview_popup_menu_activate_image_cb(GtkMenuItem *menuitem, g_free(src); } +static void textview_adj_value_changed(GtkAdjustment *adj, gpointer data) +{ + TextView *textview = (TextView *)data; + + gtk_text_view_place_cursor_onscreen(GTK_TEXT_VIEW(textview->text)); +} + static gboolean textview_uri_security_check(TextView *textview, RemoteURI *uri) { GtkTextBuffer *buffer; |