mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-22 22:56:32 +01:00
small change to logic for track selection when context/button clicking on a track header.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3177 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
7e14351aee
commit
c8616fde7e
4 changed files with 21 additions and 19 deletions
|
|
@ -171,6 +171,7 @@ Editor::set_selected_track_as_side_effect (bool force)
|
|||
}
|
||||
|
||||
if (!selection->tracks.empty()) {
|
||||
|
||||
if (!selection->selected (clicked_trackview)) {
|
||||
selection->add (clicked_trackview);
|
||||
}
|
||||
|
|
@ -201,21 +202,7 @@ Editor::set_selected_track (TimeAxisView& view, Selection::Operation op, bool no
|
|||
break;
|
||||
|
||||
case Selection::Set:
|
||||
if (selection->selected (&view) && selection->tracks.size() > 1) {
|
||||
|
||||
/* reset track selection if there is only 1 other track
|
||||
selected OR if no_remove is not set (its there to
|
||||
prevent deselecting a multi-track selection
|
||||
when clicking on an already selected track
|
||||
for some reason.
|
||||
*/
|
||||
|
||||
if (selection->tracks.empty()) {
|
||||
selection->set (&view);
|
||||
} else if (selection->tracks.size() == 1 || !no_remove) {
|
||||
selection->set (&view);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Selection::Extend:
|
||||
|
|
|
|||
|
|
@ -391,7 +391,8 @@ RouteTimeAxisView::playlist_click ()
|
|||
playlist_action_menu->set_name ("ArdourContextMenu");
|
||||
|
||||
build_playlist_menu (playlist_action_menu);
|
||||
editor.set_selected_track (*this, Selection::Add);
|
||||
|
||||
conditionally_add_to_selection ();
|
||||
playlist_action_menu->popup (1, gtk_get_current_event_time());
|
||||
}
|
||||
|
||||
|
|
@ -404,7 +405,7 @@ RouteTimeAxisView::automation_click ()
|
|||
*/
|
||||
build_display_menu ();
|
||||
}
|
||||
editor.set_selected_track (*this, Selection::Add);
|
||||
conditionally_add_to_selection ();
|
||||
automation_action_menu->popup (1, gtk_get_current_event_time());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -527,6 +527,18 @@ TimeAxisView::name_entry_button_release (GdkEventButton *ev)
|
|||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
TimeAxisView::conditionally_add_to_selection ()
|
||||
{
|
||||
Selection& s (editor.get_selection());
|
||||
|
||||
if (!s.selected (this)) {
|
||||
cerr << "set selected track\n";
|
||||
editor.set_selected_track (*this, Selection::Set);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TimeAxisView::popup_display_menu (guint32 when)
|
||||
{
|
||||
|
|
@ -534,14 +546,14 @@ TimeAxisView::popup_display_menu (guint32 when)
|
|||
build_display_menu ();
|
||||
}
|
||||
|
||||
editor.set_selected_track (*this, Selection::Add);
|
||||
conditionally_add_to_selection ();
|
||||
display_menu->popup (1, when);
|
||||
}
|
||||
|
||||
gint
|
||||
TimeAxisView::size_click (GdkEventButton *ev)
|
||||
{
|
||||
editor.set_selected_track (*this, Selection::Add);
|
||||
conditionally_add_to_selection ();
|
||||
popup_size_menu (ev->time);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,6 +336,8 @@ class TimeAxisView : public virtual AxisView
|
|||
ARDOUR::AnalysisFeatureList analysis_features;
|
||||
void reshow_feature_lines ();
|
||||
|
||||
void conditionally_add_to_selection ();
|
||||
|
||||
}; /* class TimeAxisView */
|
||||
|
||||
#endif /* __ardour_gtk_time_axis_h__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue