Commit 1a76e044 authored by Cosimo Cecchi's avatar Cosimo Cecchi

view: handle smooth scroll events for zooming

Instead of reaching the g_assert_not_reached() and crash.

https://bugzilla.gnome.org/show_bug.cgi?id=671650
parent 0d46b062
......@@ -9465,6 +9465,8 @@ gboolean
nautilus_view_handle_scroll_event (NautilusView *directory_view,
GdkEventScroll *event)
{
gdouble delta_x, delta_y;
if (event->state & GDK_CONTROL_MASK) {
switch (event->direction) {
case GDK_SCROLL_UP:
......@@ -9477,6 +9479,20 @@ nautilus_view_handle_scroll_event (NautilusView *directory_view,
nautilus_view_bump_zoom_level (directory_view, -1);
return TRUE;
case GDK_SCROLL_SMOOTH:
gdk_event_get_scroll_deltas ((const GdkEvent *) event,
&delta_x, &delta_y);
if (delta_y > 0) {
nautilus_view_bump_zoom_level (directory_view, 1);
return TRUE;
} else if (delta_y < 0) {
nautilus_view_bump_zoom_level (directory_view, -1);
return TRUE;
} else {
break;
}
case GDK_SCROLL_LEFT:
case GDK_SCROLL_RIGHT:
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment