diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-04 20:17:38 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-04 20:17:38 +0000 |
commit | 3293f957bd8424344195603cc8c1f08601453563 (patch) | |
tree | f1fe3f35d8609095553aa732772893e51e286c19 | |
parent | 4a3d7877f6b03fac7755f997b945583ba5732d13 (diff) |
handle left/right scroll in editor summary, and use secondary & tertiary modifiers to change scrolling distances
git-svn-id: svn://localhost/ardour2/branches/3.0@6284 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/editor_summary.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 764ec31a30..7998b090d6 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -409,14 +409,22 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev) pair<double, double> yr; get_editor (&xr, &yr); - double const amount = 8; + 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::PrimaryModifier)) { + /* primary-wheel == left-right scrolling */ + if (ev->direction == GDK_SCROLL_UP) { xr.first += amount; xr.second += amount; - } else { + } else if (ev->direction == GDK_SCROLL_DOWN) { xr.first -= amount; xr.second -= amount; } @@ -426,11 +434,16 @@ EditorSummary::on_scroll_event (GdkEventScroll* ev) if (ev->direction == GDK_SCROLL_DOWN) { yr.first += amount; yr.second += amount; - } else { + } else if (ev->direction == GDK_SCROLL_UP) { yr.first -= amount; yr.second -= amount; + } else if (ev->direction == GDK_SCROLL_LEFT) { + xr.first -= amount; + xr.second -= amount; + } else if (ev->direction == GDK_SCROLL_RIGHT) { + xr.first += amount; + xr.second += amount; } - } set_editor (xr, yr); |