aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-05-15 22:23:10 +0800
committerMilan Crha <mcrha@redhat.com>2012-05-15 22:24:29 +0800
commit5e379370ae0653c229308e1d7af31a54739ccc7e (patch)
treea9079e286e9e6a006d58ffa064d53d50091aab03 /calendar
parent0f7f848300bb2282cde20777c26168bdffe2d955 (diff)
downloadgsoc2013-evolution-5e379370ae0653c229308e1d7af31a54739ccc7e.tar
gsoc2013-evolution-5e379370ae0653c229308e1d7af31a54739ccc7e.tar.gz
gsoc2013-evolution-5e379370ae0653c229308e1d7af31a54739ccc7e.tar.bz2
gsoc2013-evolution-5e379370ae0653c229308e1d7af31a54739ccc7e.tar.lz
gsoc2013-evolution-5e379370ae0653c229308e1d7af31a54739ccc7e.tar.xz
gsoc2013-evolution-5e379370ae0653c229308e1d7af31a54739ccc7e.tar.zst
gsoc2013-evolution-5e379370ae0653c229308e1d7af31a54739ccc7e.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 ad7fd78cd3..be096b5e6b 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -3276,6 +3276,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;
}
@@ -3295,9 +3303,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
@@ -3319,9 +3337,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;
}