summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_summary.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-01-07 11:33:45 +1000
committerTim Mayberry <mojofunk@gmail.com>2016-01-21 11:25:56 +1000
commit2a138919703d0d9266ea5246529323743ea8f4cd (patch)
treeec848fe4023318e655c7c06c32e7d28b2e1c4423 /gtk2_ardour/editor_summary.cc
parent08cbe0532cdb948d993530028dd4e2e1194feea5 (diff)
Change scrolling in the Editor track canvas summary area
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.
Diffstat (limited to 'gtk2_ardour/editor_summary.cc')
-rw-r--r--gtk2_ardour/editor_summary.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc
index baf1e4970a..ba03d91e2d 100644
--- a/gtk2_ardour/editor_summary.cc
+++ b/gtk2_ardour/editor_summary.cc
@@ -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: