Change scrolling in the Editor track canvas summary area
authorTim Mayberry <mojofunk@gmail.com>
Thu, 7 Jan 2016 01:33:45 +0000 (11:33 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Thu, 21 Jan 2016 01:25:56 +0000 (11:25 +1000)
Keep scroll distance consistent when scrolling up and down with horizontal
modifier as when scrolling left to right.

Scroll horizonally by half a page so that no sections of the canvas are skipped
when scrolling.

Scroll by half a page rather than a step like when scrolling in the track
canvas area as it is a summary area so larger steps seem acceptable and having
it use the same scroll distance as when scrolling in the track canvas seems
pointless as you would then just scroll in the track canvas area.

gtk2_ardour/editor_summary.cc

index baf1e4970a1fe0592bf0ea1015b466326eecba14..ba03d91e2dce2cb9b9253c232db5fdbe84ead6e6 100644 (file)
@@ -695,7 +695,8 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev)
        switch (ev->direction) {
                case GDK_SCROLL_UP:
                        if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
-                               x -= 64;
+                               _editor->scroll_left_half_page ();
+                               return true;
                        } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
                                _editor->temporal_zoom_step (false);
                        } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
@@ -709,7 +710,8 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev)
                        break;
                case GDK_SCROLL_DOWN:
                        if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
-                               x += 64;
+                               _editor->scroll_right_half_page ();
+                               return true;
                        } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
                                _editor->temporal_zoom_step (true);
                        } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
@@ -727,7 +729,8 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev)
                        } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
                                x -= 1;
                        } else {
-                               x -= 8;
+                               _editor->scroll_left_half_page ();
+                               return true;
                        }
                        break;
                case GDK_SCROLL_RIGHT:
@@ -736,7 +739,8 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev)
                        } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
                                x += 1;
                        } else {
-                               x += 8;
+                               _editor->scroll_right_half_page ();
+                               return true;
                        }
                        break;
                default: