handle GDK_SCROLL_SMOOTH when handling mouse scroll on tabs
adapted from: https://git.gnome.org/browse/gnome-terminal/commit/?id=70965e71db7d1c2fac0237988344972b564c46b5 https://git.gnome.org/browse/gnome-terminal/commit/?id=35a509165750d0ecefe9f26702d0f3c0e230f0c2master-1.22
parent
8d2eb08981
commit
622e2d1272
|
@ -2931,6 +2931,24 @@ notebook_scroll_event_cb (GtkWidget *widget,
|
|||
case GDK_SCROLL_UP:
|
||||
gtk_notebook_prev_page (notebook);
|
||||
break;
|
||||
case GDK_SCROLL_SMOOTH:
|
||||
switch (gtk_notebook_get_tab_pos (notebook)) {
|
||||
case GTK_POS_LEFT:
|
||||
case GTK_POS_RIGHT:
|
||||
if (event->delta_y > 0)
|
||||
gtk_notebook_next_page (notebook);
|
||||
else if (event->delta_y < 0)
|
||||
gtk_notebook_prev_page (notebook);
|
||||
break;
|
||||
case GTK_POS_TOP:
|
||||
case GTK_POS_BOTTOM:
|
||||
if (event->delta_x > 0)
|
||||
gtk_notebook_next_page (notebook);
|
||||
else if (event->delta_x < 0)
|
||||
gtk_notebook_prev_page (notebook);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue