From 94c77987124d017698f158eadeb4854414d4bca3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 19 Jan 2013 05:36:43 +0000 Subject: 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 --- gtk2_ardour/midi_time_axis.cc | 15 ++++++++++----- libs/midi++2/midi++/midnam_patch.h | 2 -- 2 files changed, 10 insertions(+), 7 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 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::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::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(); } diff --git a/libs/midi++2/midi++/midnam_patch.h b/libs/midi++2/midi++/midnam_patch.h index 20e1b95714..bae5241f98 100644 --- a/libs/midi++2/midi++/midnam_patch.h +++ b/libs/midi++2/midi++/midnam_patch.h @@ -15,8 +15,6 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ */ #ifndef MIDNAM_PATCH_H_ -- cgit v1.2.3