diff options
author | David Robillard <d@drobilla.net> | 2013-01-19 05:36:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-19 05:36:43 +0000 |
commit | 94c77987124d017698f158eadeb4854414d4bca3 (patch) | |
tree | d87d38a70b095b8ac4d32790bbfd9e2e6ca20730 /gtk2_ardour/midi_time_axis.cc | |
parent | 458b5c1d48b8f9ba14daf8121d2e93d9857a4946 (diff) |
Hide MIDI device mode selector unless there is actually more than one mode.
Since this is usually not the case, showing this all the time as before was so
confusing everyone thought it was broken (myself included).
Changing that show_all() to a show() might have consequences, but it seems to
work fine and we really shouldn't be using show_all() anyway.
git-svn-id: svn://localhost/ardour2/branches/3.0@13889 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 9db4a18ef4..d5bb0aaae6 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -238,7 +238,7 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt) _midnam_custom_device_mode_selector.set_size_request(10, 30); _midnam_custom_device_mode_selector.set_border_width(2); - _midi_controls_box.attach(_midnam_custom_device_mode_selector, 1, 2, 2, 3); + _midi_controls_box.attach(_midnam_custom_device_mode_selector, 0, 1, 3, 4); } else { _midi_controls_box.attach(_channel_selector, 0, 1, 0, 1); } @@ -341,9 +341,14 @@ MidiTimeAxisView::model_changed() _midnam_custom_device_mode_selector.clear_items(); - for (std::list<std::string>::const_iterator i = device_modes.begin(); - i != device_modes.end(); ++i) { - _midnam_custom_device_mode_selector.append_text(*i); + if (device_modes.size() < 2) { + _midnam_custom_device_mode_selector.hide(); + } else { + _midnam_custom_device_mode_selector.show(); + for (std::list<std::string>::const_iterator i = device_modes.begin(); + i != device_modes.end(); ++i) { + _midnam_custom_device_mode_selector.append_text(*i); + } } _midnam_custom_device_mode_selector.set_active(0); @@ -369,7 +374,7 @@ void MidiTimeAxisView::set_height (uint32_t h) { if (h >= MIDI_CONTROLS_BOX_MIN_HEIGHT) { - _midi_controls_box.show_all (); + _midi_controls_box.show (); } else { _midi_controls_box.hide(); } |