summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-03-24 19:49:21 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-03-24 19:49:21 +0000
commitc8616fde7e43a956bf6ce43a14a4cec1eb3cd985 (patch)
tree3c4a388c60ee670d89243c4aa55d49f61b5d00bd
parent7e14351aee59c83d71b4b1d137138a1e5874632b (diff)
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
-rw-r--r--gtk2_ardour/editor_selection.cc17
-rw-r--r--gtk2_ardour/route_time_axis.cc5
-rw-r--r--gtk2_ardour/time_axis_view.cc16
-rw-r--r--gtk2_ardour/time_axis_view.h2
4 files changed, 21 insertions, 19 deletions
diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc
index 1c22668d99..371f84a2f6 100644
--- a/gtk2_ardour/editor_selection.cc
+++ b/gtk2_ardour/editor_selection.cc
@@ -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);
- }
- }
+ selection->set (&view);
break;
case Selection::Extend:
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 7997a26e65..95417d5a5e 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -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());
}
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index 207402a7cb..01f81c0f09 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -528,20 +528,32 @@ TimeAxisView::name_entry_button_release (GdkEventButton *ev)
}
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)
{
if (display_menu == 0) {
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;
}
diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h
index 7faf0e344f..2c8bb2ffb4 100644
--- a/gtk2_ardour/time_axis_view.h
+++ b/gtk2_ardour/time_axis_view.h
@@ -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__ */