aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-05-15 22:24:48 +0800
committerMilan Crha <mcrha@redhat.com>2012-05-15 22:24:48 +0800
commit9cc518864da6dc5898617be0b17bfdc59f892811 (patch)
tree917c0757fc21c73e5ea984ffa58280e73038bc04 /calendar
parentae3b1205b9bfa28de0104eb0dbac766b380e8c49 (diff)
downloadgsoc2013-evolution-9cc518864da6dc5898617be0b17bfdc59f892811.tar.gz
gsoc2013-evolution-9cc518864da6dc5898617be0b17bfdc59f892811.tar.zst
gsoc2013-evolution-9cc518864da6dc5898617be0b17bfdc59f892811.zip
Bug #671585 - Add support for smooth scrolling devices
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/e-day-view.c32
-rw-r--r--calendar/gui/e-week-view.c8
2 files changed, 38 insertions, 2 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 89694506f1..af9e72366e 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -3273,6 +3273,14 @@ e_day_view_on_main_canvas_scroll (GtkWidget *widget,
case GDK_SCROLL_DOWN:
e_day_view_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
return TRUE;
+ #if GTK_CHECK_VERSION(3,3,18)
+ case GDK_SCROLL_SMOOTH:
+ if (scroll->delta_y < -0.001 || scroll->delta_y > 0.001) {
+ e_day_view_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE * scroll->delta_y);
+ return TRUE;
+ }
+ break;
+ #endif
default:
break;
}
@@ -3292,9 +3300,19 @@ e_day_view_on_top_canvas_scroll (GtkWidget *widget,
case GDK_SCROLL_DOWN:
e_day_view_top_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
return TRUE;
+ #if GTK_CHECK_VERSION(3,3,18)
+ case GDK_SCROLL_SMOOTH:
+ if (scroll->delta_y < -0.001 || scroll->delta_y > 0.001) {
+ e_day_view_top_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE * scroll->delta_y);
+ return TRUE;
+ }
+ break;
+ #endif
default:
- return FALSE;
+ break;
}
+
+ return FALSE;
}
static gboolean
@@ -3316,9 +3334,19 @@ e_day_view_on_time_canvas_scroll (GtkWidget *widget,
case GDK_SCROLL_DOWN:
e_day_view_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE);
return TRUE;
+ #if GTK_CHECK_VERSION(3,3,18)
+ case GDK_SCROLL_SMOOTH:
+ if (scroll->delta_y < -0.001 || scroll->delta_y > 0.001) {
+ e_day_view_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE * scroll->delta_y);
+ return TRUE;
+ }
+ break;
+ #endif
default:
- return FALSE;
+ break;
}
+
+ return FALSE;
}
static gboolean
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 3feacccfda..dd419d289c 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -2532,6 +2532,14 @@ e_week_view_on_scroll (GtkWidget *widget,
case GDK_SCROLL_DOWN:
new_value = value + page_increment;
break;
+ #if GTK_CHECK_VERSION(3,3,18)
+ case GDK_SCROLL_SMOOTH:
+ if (scroll->delta_y < -0.001 || scroll->delta_y > 0.001) {
+ new_value = value + scroll->delta_y;
+ break;
+ }
+ return FALSE;
+ #endif
default:
return FALSE;
}