diff options
author | TingPing <TingPing@users.noreply.github.com> | 2013-10-04 14:43:42 -0700 |
---|---|---|
committer | TingPing <TingPing@users.noreply.github.com> | 2013-10-04 14:43:42 -0700 |
commit | b1df2f43aa0af55614d29f44064233024f0b29a8 (patch) | |
tree | e6f894979179d7b05d057627297d3a52ed556fc1 /src/fe-gtk/chanview-tree.c | |
parent | e10faa0369d498eff12c9f9536d0b81c944a339c (diff) | |
parent | 65eb233f9c8f8d2b632e46e75eec22075143e03b (diff) |
Merge pull request #784 from Farow/pull2
tree-view: switch tabs on mouse wheel up/down
Diffstat (limited to 'src/fe-gtk/chanview-tree.c')
-rw-r--r-- | src/fe-gtk/chanview-tree.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/fe-gtk/chanview-tree.c b/src/fe-gtk/chanview-tree.c index 5eb19ad2..4e9dd8a8 100644 --- a/src/fe-gtk/chanview-tree.c +++ b/src/fe-gtk/chanview-tree.c @@ -89,6 +89,15 @@ cv_tree_click_cb (GtkTreeView *tree, GdkEventButton *event, chanview *cv) } static void +cv_tree_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event) +{ + if (event->direction == GDK_SCROLL_DOWN) + mg_switch_page (1, 1); + else if (event->direction == GDK_SCROLL_UP) + mg_switch_page (1, -1); +} + +static void cv_tree_init (chanview *cv) { GtkWidget *view, *win; @@ -163,6 +172,8 @@ cv_tree_init (chanview *cv) G_CALLBACK (cv_tree_click_cb), cv); g_signal_connect (G_OBJECT (view), "row-activated", G_CALLBACK (cv_tree_activated_cb), NULL); + g_signal_connect (G_OBJECT (view), "scroll_event", + G_CALLBACK (cv_tree_scroll_event_cb), NULL); gtk_drag_dest_set (view, GTK_DEST_DEFAULT_ALL, dnd_dest_target, 1, GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK); |