diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index ef94034569..3ac5fc6c38 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -428,9 +428,13 @@ TimeAxisView::set_heights (uint32_t h) } void -TimeAxisView::set_height_enum (Height h) +TimeAxisView::set_height_enum (Height h, bool apply_to_selection) { - set_height (preset_height (h)); + if (apply_to_selection) { + _editor.get_selection().tracks.foreach_time_axis (boost::bind (&TimeAxisView::set_height_enum, _1, h, false)); + } else { + set_height (preset_height (h)); + } } void @@ -1362,10 +1366,10 @@ TimeAxisView::build_size_menu () _size_menu->set_name ("ArdourContextMenu"); MenuList& items = _size_menu->items(); - items.push_back (MenuElem (_("Largest"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLargest))); - items.push_back (MenuElem (_("Larger"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarger))); - items.push_back (MenuElem (_("Large"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarge))); - items.push_back (MenuElem (_("Normal"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightNormal))); - items.push_back (MenuElem (_("Smaller"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmaller))); - items.push_back (MenuElem (_("Small"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmall))); + items.push_back (MenuElem (_("Largest"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLargest, true))); + items.push_back (MenuElem (_("Larger"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarger, true))); + items.push_back (MenuElem (_("Large"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarge, true))); + items.push_back (MenuElem (_("Normal"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightNormal, true))); + items.push_back (MenuElem (_("Smaller"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmaller, true))); + items.push_back (MenuElem (_("Small"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmall, true))); } diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 16c527d2be..9630b3f19c 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -149,7 +149,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful virtual void exited () {} virtual void set_height (uint32_t h); - void set_height_enum (Height); + void set_height_enum (Height, bool apply_to_selection = false); void reset_height(); std::pair covers_y_position (double); diff --git a/gtk2_ardour/track_selection.h b/gtk2_ardour/track_selection.h index 46c04183a4..68ec3b7bd6 100644 --- a/gtk2_ardour/track_selection.h +++ b/gtk2_ardour/track_selection.h @@ -35,6 +35,13 @@ public: TrackViewList add (TrackViewList const &); + template + void foreach_time_axis (Function f) { + for (iterator i = begin(); i != end(); ++i) { + f (*i); + } + } + template void foreach_route_ui (Function f) { for (iterator i = begin(); i != end(); ++i) {