From d1e55ff5b7b4e7f9da32ff05898487aff7d8bdc2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 3 Apr 2020 17:58:39 -0600 Subject: add RouteTimeAxis::toggle_layer_display() --- gtk2_ardour/route_time_axis.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gtk2_ardour/route_time_axis.cc') 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 @@ -2324,6 +2324,28 @@ RouteTimeAxisView::blink_rec_display (bool onoff) RouteUI::blink_rec_display (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(overlaid_menu_item)->get_active()) { + dynamic_cast(stacked_menu_item)->set_active (true); + } else { + dynamic_cast(overlaid_menu_item)->set_active (true); + } +} + void RouteTimeAxisView::set_layer_display (LayerDisplay d, bool apply_to_selection) { -- cgit v1.2.3