diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-13 19:39:36 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-13 19:39:36 +0000 |
commit | 40e9dae606c034ce078e929421f8ae122dda4efc (patch) | |
tree | 144c5f67391393fcee01d84c8070aa899873f4cd /gtk2_ardour/editor_mouse.cc | |
parent | 2292e33ee418070c4d12971a72e01eb29dfc8de9 (diff) |
various fixes for "advanced" operations on range selections. ctrl-drags now add a new range selection, allowing discontiguous selections as in ardour2, shift-click extends an existing range selection to the clicked position, alt-drag on a range selection moves it, and to do a so-called "separation drag" now use ctrl-alt-drag (or ctrl-alt-click)
git-svn-id: svn://localhost/ardour2/branches/3.0@13660 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index cce09f8baf..9452b5e2a4 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -598,23 +598,25 @@ Editor::button_selection (ArdourCanvas::Item* /*item*/, GdkEvent* event, ItemTyp switch (item_type) { case RegionItem: - if (press) { - if (mouse_mode != MouseRange) { - set_selected_regionview_from_click (press, op); + if (!get_smart_mode() || (_join_object_range_state == JOIN_OBJECT_RANGE_OBJECT)) { + if (press) { + if (mouse_mode != MouseRange) { + set_selected_regionview_from_click (press, op); + } else { + /* don't change the selection unless the + clicked track is not currently selected. if + so, "collapse" the selection to just this + track + */ + if (!selection->selected (clicked_axisview)) { + set_selected_track_as_side_effect (Selection::Set); + } + } } else { - /* don't change the selection unless the - clicked track is not currently selected. if - so, "collapse" the selection to just this - track - */ - if (!selection->selected (clicked_axisview)) { - set_selected_track_as_side_effect (Selection::Set); + if (mouse_mode != MouseRange) { + set_selected_regionview_from_click (press, op); } } - } else { - if (mouse_mode != MouseRange) { - set_selected_regionview_from_click (press, op); - } } break; @@ -800,9 +802,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT break; case SelectionItem: - if (Keyboard::modifier_state_contains - (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier))) { - // contains and not equals because I can't use alt as a modifier alone. + if (Keyboard::modifier_state_contains (event->button.state, Keyboard::ModifierMask(Keyboard::PrimaryModifier|Keyboard::SecondaryModifier))) { start_selection_grab (item, event); } else if (Keyboard::modifier_state_equals (event->button.state, Keyboard::SecondaryModifier)) { /* grab selection for moving */ @@ -831,7 +831,11 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT return true; } } else { - _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event); + if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier)) { + _drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event); + } else { + _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event); + } return true; } break; @@ -855,7 +859,11 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT default: if (!internal_editing()) { - _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event); + if (Keyboard::modifier_state_equals (event->button.state, Keyboard::RangeSelectModifier)) { + _drags->set (new SelectionDrag (this, item, SelectionDrag::SelectionExtend), event); + } else { + _drags->set (new SelectionDrag (this, item, SelectionDrag::CreateSelection), event); + } } } return true; |