diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-06-25 22:24:47 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-06-25 22:24:47 -0400 |
commit | 3031a99364333b9adcc52c4922687477a1e62337 (patch) | |
tree | 226d75d493f0a7444aaea534a5d8e18020ccf095 /gtk2_ardour/editor_summary.cc | |
parent | 2b74c955f1e10896cc28c3937b884ad4723c0476 (diff) | |
parent | 4a7c615714691984009a9fc05ebaeaceb335b641 (diff) |
Merge branch 'master' into cairocanvas
Diffstat (limited to 'gtk2_ardour/editor_summary.cc')
-rw-r--r-- | gtk2_ardour/editor_summary.cc | 88 |
1 files changed, 49 insertions, 39 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 557636dbf7..1c30df4f3a 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -627,45 +627,55 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev) double x = xr.first; double y = yr.first; - double amount = 8; - - if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) { - amount = 64; - } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) { - amount = 1; - } - - if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) { - - /* secondary-wheel == left-right scrolling */ - - if (ev->direction == GDK_SCROLL_UP) { - x -= amount; - } else if (ev->direction == GDK_SCROLL_DOWN) { - x += amount; - } - - } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) { - - /* primary-wheel == zoom */ - - if (ev->direction == GDK_SCROLL_UP) { - _editor->temporal_zoom_step (false); - } else { - _editor->temporal_zoom_step (true); - } - - } else { - - if (ev->direction == GDK_SCROLL_DOWN) { - y += amount; - } else if (ev->direction == GDK_SCROLL_UP) { - y -= amount; - } else if (ev->direction == GDK_SCROLL_LEFT) { - x -= amount; - } else if (ev->direction == GDK_SCROLL_RIGHT) { - x += amount; - } + switch (ev->direction) { + case GDK_SCROLL_UP: + if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) { + x -= 64; + } 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)) { + yr.first += 4; + yr.second -= 4; + set_editor (xr, yr); + return true; + } else { + y -= 8; + } + break; + case GDK_SCROLL_DOWN: + if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) { + x += 64; + } 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)) { + yr.first -= 4; + yr.second += 4; + set_editor (xr, yr); + return true; + } else { + y += 8; + } + break; + case GDK_SCROLL_LEFT: + if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) { + x -= 64; + } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) { + x -= 1; + } else { + x -= 8; + } + break; + case GDK_SCROLL_RIGHT: + if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) { + x += 64; + } else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) { + x += 1; + } else { + x += 8; + } + break; + default: + break; } set_editor (x, y); |