diff options
author | Kristian Rietveld <kris@gtk.org> | 2005-06-19 17:37:07 +0000 |
---|---|---|
committer | Kristian Rietveld <kristian@src.gnome.org> | 2005-06-19 17:37:07 +0000 |
commit | e02fe68aeb8bf95575313161bb720e255bd56c70 (patch) | |
tree | e37fb998125cb3516c55585a1eeab52d32f35cd0 /gtk | |
parent | afc4b03c7359893045850353fabf5db8d5182361 (diff) | |
download | gdk-pixbuf-e02fe68aeb8bf95575313161bb720e255bd56c70.tar.gz |
Make mousewheel scrolling possible in typeahead mode, suggestion from
2005-06-19 Kristian Rietveld <kris@gtk.org>
Make mousewheel scrolling possible in typeahead mode, suggestion
from Reinout van Schouwen (#307898).
* gtk/gtktreeview.c (gtk_tree_view_ensure_interactive_directory):
connect treeview search window to scroll_event signal,
(gtk_tree_view_search_scroll_event): implement.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtktreeview.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 7a80fc913..914624ce6 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -400,6 +400,9 @@ static gboolean gtk_tree_view_search_delete_event (GtkWidget *widge static gboolean gtk_tree_view_search_button_press_event (GtkWidget *widget, GdkEventButton *event, GtkTreeView *tree_view); +static gboolean gtk_tree_view_search_scroll_event (GtkWidget *entry, + GdkEventScroll *event, + GtkTreeView *tree_view); static gboolean gtk_tree_view_search_key_press_event (GtkWidget *entry, GdkEventKey *event, GtkTreeView *tree_view); @@ -9026,6 +9029,9 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view) g_signal_connect (tree_view->priv->search_window, "button_press_event", G_CALLBACK (gtk_tree_view_search_button_press_event), tree_view); + g_signal_connect (tree_view->priv->search_window, "scroll_event", + G_CALLBACK (gtk_tree_view_search_scroll_event), + tree_view); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN); @@ -12524,6 +12530,27 @@ gtk_tree_view_search_button_press_event (GtkWidget *widget, } static gboolean +gtk_tree_view_search_scroll_event (GtkWidget *widget, + GdkEventScroll *event, + GtkTreeView *tree_view) +{ + gboolean retval = FALSE; + + if (event->direction == GDK_SCROLL_UP) + { + gtk_tree_view_search_move (widget, tree_view, TRUE); + retval = TRUE; + } + else if (event->direction == GDK_SCROLL_DOWN) + { + gtk_tree_view_search_move (widget, tree_view, FALSE); + retval = TRUE; + } + + return retval; +} + +static gboolean gtk_tree_view_search_key_press_event (GtkWidget *widget, GdkEventKey *event, GtkTreeView *tree_view) |