diff options
author | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2013-07-23 16:15:23 +0100 |
---|---|---|
committer | Colin Fletcher <colin.m.fletcher@googlemail.com> | 2013-07-23 16:42:34 +0100 |
commit | 8e376f7a2a2cd490860bd1c233b7e688ac9ffba3 (patch) | |
tree | e56d19a73f94d6fc815715184c8e207cf2403826 /gtk2_ardour | |
parent | d5209cb4bfb1a3ee41ffb45ec0ead71a540f19d1 (diff) |
Fix special handling of 'zoom vertical' scroll wheel modifier key.
gtkmm2ext/keyboard.cc has a special case to emit a signal on the key-up of
the modifier key used to adjust track heights in conjunction with the
scroll wheel, so that the same track continues to be resized even when
it's shrunk to no longer be under the mouse cursor. However, this code
assumed that the modifier key for this was <Shift>.
Fix it to use the event->state bit corresponding to
ScrollZoomVerticalModifier instead, and rename the relevant functions to
clarify that it's the 'zoom vertical' modifier key they're dealing with.
Partially fixes #5610.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index d3e3ae9828..300e317a38 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -697,7 +697,7 @@ Editor::Editor () signal_configure_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler)); signal_delete_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::exit_on_main_window_close)); - Gtkmm2ext::Keyboard::the_keyboard().ShiftReleased.connect (sigc::mem_fun (*this, &Editor::shift_key_released)); + Gtkmm2ext::Keyboard::the_keyboard().ZoomVerticalModifierReleased.connect (sigc::mem_fun (*this, &Editor::zoom_vertical_modifier_released)); /* allow external control surfaces/protocols to do various things */ @@ -5499,7 +5499,7 @@ Editor::popup_control_point_context_menu (ArdourCanvas::Item* item, GdkEvent* ev } void -Editor::shift_key_released () +Editor::zoom_vertical_modifier_released() { _stepping_axis_view = 0; } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index c12d1354d1..033888c4b6 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2082,15 +2082,16 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool _control_point_toggled_on_press; /** This is used by TimeAxisView to keep a track of the TimeAxisView that is currently being - stepped in height using Shift-Scrollwheel. When a scroll event occurs, we do the step on - this _stepping_axis_view if it is non-0 (and we set up this _stepping_axis_view with the - TimeAxisView underneath the mouse if it is 0). Then Editor resets _stepping_axis_view when - the shift key is released. In this (hacky) way, pushing shift and moving the scroll wheel - will operate on the same track until shift is released (rather than skipping about to whatever - happens to be underneath the mouse at the time). + stepped in height using ScrollZoomVerticalModifier+Scrollwheel. When a scroll event + occurs, we do the step on this _stepping_axis_view if it is non-0 (and we set up this + _stepping_axis_view with the TimeAxisView underneath the mouse if it is 0). Then Editor + resets _stepping_axis_view when the modifier key is released. In this (hacky) way, + pushing the modifier key and moving the scroll wheel will operate on the same track + until the key is released (rather than skipping about to whatever happens to be + underneath the mouse at the time). */ TimeAxisView* _stepping_axis_view; - void shift_key_released (); + void zoom_vertical_modifier_released(); friend class Drag; friend class RegionDrag; |