From 68082abc22de11940c23614d6563b02229650ead Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 10 Jul 2020 18:16:18 +0200 Subject: [PATCH] Fix track-header visibility for inactive tracks This supersedes 0708cdb6b4a3, an explicit `name_label.show()` is not needed. The inactive label was missing an explicit call to show. This also fixes MIDI track MIDNAM Selector visibility --- gtk2_ardour/audio_time_axis.cc | 1 - gtk2_ardour/midi_time_axis.cc | 18 +++++++++++++++++- gtk2_ardour/midi_time_axis.h | 1 + gtk2_ardour/time_axis_view.cc | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 12f3cea0bb..aa09bb4050 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -296,7 +296,6 @@ AudioTimeAxisView::route_active_changed () controls_table.hide(); inactive_table.show(); RouteTimeAxisView::hide_all_automation(); - name_label.show(); } else { inactive_table.hide(); controls_table.show(); diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index f6a936a836..ae8c27a632 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -558,9 +558,24 @@ MidiTimeAxisView::midi_view() return dynamic_cast(_view); } +void +MidiTimeAxisView::update_midi_controls_visibility (uint32_t h) +{ + if (_route && !_route->active ()) { + h = 0; + } + if (h >= MIDI_CONTROLS_BOX_MIN_HEIGHT) { + _midi_controls_box.show (); + } else { + _midi_controls_box.hide(); + } +} + void MidiTimeAxisView::set_height (uint32_t h, TrackHeightMode m) { + update_midi_controls_visibility (h); + if (h >= MIDI_CONTROLS_BOX_MIN_HEIGHT) { _midi_controls_box.show (); } else { @@ -1356,10 +1371,11 @@ MidiTimeAxisView::route_active_changed () { RouteTimeAxisView::route_active_changed (); update_control_names(); + update_midi_controls_visibility (height); if (!_route->active()) { controls_table.hide(); - inactive_table.show_all(); + inactive_table.show(); RouteTimeAxisView::hide_all_automation(); } else { inactive_table.hide(); diff --git a/gtk2_ardour/midi_time_axis.h b/gtk2_ardour/midi_time_axis.h index 78a7f95cee..8f3a7cc0a7 100644 --- a/gtk2_ardour/midi_time_axis.h +++ b/gtk2_ardour/midi_time_axis.h @@ -142,6 +142,7 @@ private: void contents_height_changed (); void update_control_names (); + void update_midi_controls_visibility (uint32_t); bool _ignore_signals; std::string _effective_model; diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index feb15c4192..242ae44482 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -175,6 +175,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie name_label.set_size_request(name_width_px, -1); name_label.show (); + inactive_label.show (); controls_table.set_row_spacings (2); controls_table.set_col_spacings (2);