1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-22 09:12:22 -05:00

Merge pull request #784 from Farow/pull2

tree-view: switch tabs on mouse wheel up/down
This commit is contained in:
TingPing 2013-10-04 14:43:42 -07:00
commit b1df2f43aa

View File

@ -88,6 +88,15 @@ cv_tree_click_cb (GtkTreeView *tree, GdkEventButton *event, chanview *cv)
return ret; return ret;
} }
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 static void
cv_tree_init (chanview *cv) cv_tree_init (chanview *cv)
{ {
@ -163,6 +172,8 @@ cv_tree_init (chanview *cv)
G_CALLBACK (cv_tree_click_cb), cv); G_CALLBACK (cv_tree_click_cb), cv);
g_signal_connect (G_OBJECT (view), "row-activated", g_signal_connect (G_OBJECT (view), "row-activated",
G_CALLBACK (cv_tree_activated_cb), NULL); 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, gtk_drag_dest_set (view, GTK_DEST_DEFAULT_ALL, dnd_dest_target, 1,
GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK); GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);