diff options
-rw-r--r-- | gtk2_ardour/route_time_axis.cc | 22 | ||||
-rw-r--r-- | gtk2_ardour/route_time_axis.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 6eab8137e7..d092f58a45 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -2325,6 +2325,28 @@ RouteTimeAxisView::blink_rec_display (bool onoff) } void +RouteTimeAxisView::toggle_layer_display () +{ + /* this is a bit of a hack, but we implement toggle via the menu items, + in order to keep them in sync with the visual state. + */ + + if (!is_track()) { + return; + } + + if (!display_menu) { + build_display_menu (); + } + + if (dynamic_cast<RadioMenuItem*>(overlaid_menu_item)->get_active()) { + dynamic_cast<RadioMenuItem*>(stacked_menu_item)->set_active (true); + } else { + dynamic_cast<RadioMenuItem*>(overlaid_menu_item)->set_active (true); + } +} + +void RouteTimeAxisView::set_layer_display (LayerDisplay d, bool apply_to_selection) { if (_ignore_set_layer_display) { diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h index 5defd543db..de6bb441a9 100644 --- a/gtk2_ardour/route_time_axis.h +++ b/gtk2_ardour/route_time_axis.h @@ -103,6 +103,7 @@ public: void get_selectables (ARDOUR::samplepos_t start, ARDOUR::samplepos_t end, double top, double bot, std::list<Selectable *>&, bool within = false); void get_inverted_selectables (Selection&, std::list<Selectable*>&); void set_layer_display (LayerDisplay d, bool apply_to_selection = false); + void toggle_layer_display (); LayerDisplay layer_display () const; boost::shared_ptr<ARDOUR::Region> find_next_region (samplepos_t pos, ARDOUR::RegionPoint, int32_t dir); |