+bool
+Editor::canvas_ruler_event (GdkEvent *event, ArdourCanvas::Item* item, ItemType type)
+{
+ bool handled = false;
+
+ if (event->type == GDK_SCROLL) {
+
+ /* scroll events in the rulers are handled a little differently from
+ scrolling elsewhere in the canvas.
+ */
+
+ switch (event->scroll.direction) {
+ case GDK_SCROLL_UP:
+ if (Keyboard::modifier_state_equals(event->scroll.state,
+ Keyboard::ScrollHorizontalModifier)) {
+ scroll_left_step ();
+ } else if (UIConfiguration::instance().get_use_mouse_position_as_zoom_focus_on_scroll()) {
+ temporal_zoom_step_mouse_focus (false);
+ } else {
+ temporal_zoom_step (false);
+ }
+ handled = true;
+ break;
+
+ case GDK_SCROLL_DOWN:
+ if (Keyboard::modifier_state_equals(event->scroll.state,
+ Keyboard::ScrollHorizontalModifier)) {
+ scroll_right_step ();
+ } else if (UIConfiguration::instance().get_use_mouse_position_as_zoom_focus_on_scroll()) {
+ temporal_zoom_step_mouse_focus (true);
+ } else {
+ temporal_zoom_step (true);
+ }
+ handled = true;
+ break;
+
+ case GDK_SCROLL_LEFT:
+ scroll_left_half_page ();
+ handled = true;
+ break;
+
+ case GDK_SCROLL_RIGHT:
+ scroll_right_half_page ();
+ handled = true;
+ break;
+
+ default:
+ /* what? */
+ break;
+ }
+ return handled;
+ }
+
+ return typed_event (item, event, type);
+}
+