diff options
author | Carl Hetherington <carl@carlh.net> | 2012-06-13 20:37:34 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-06-13 20:37:34 +0000 |
commit | 4a174039ae3282882dd0b06f7f7689bed97e211a (patch) | |
tree | 8c00ea7c59c297f19b7908c408ee32378bc35dd4 /gtk2_ardour/midi_time_axis.cc | |
parent | 5c60eea32afacc738eee9d96aeac7f963432e36d (diff) |
Shrink the midi scroomer to match the keyboard in stacked mode.
git-svn-id: svn://localhost/ardour2/branches/3.0@12710 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 80a5a50c0c..f0a9a8b2d4 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -125,7 +125,7 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt) _route = rt; _view = new MidiStreamView (*this); - + if (is_track ()) { _piano_roll_header = new PianoRollHeader(*midi_view()); _range_scroomer = new MidiScroomer(midi_view()->note_range_adjustment); @@ -145,6 +145,7 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt) midi_view()->apply_note_range (atoi (gui_property ("note-range-min").c_str()), atoi (gui_property ("note-range-max").c_str()), true); } midi_view()->NoteRangeChanged.connect (sigc::mem_fun (*this, &MidiTimeAxisView::note_range_changed)); + _view->ContentsHeightChanged.connect (sigc::mem_fun (*this, &MidiTimeAxisView::contents_height_changed)); ignore_toggle = false; @@ -171,7 +172,13 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt) _range_scroomer->DragStarting.connect (sigc::mem_fun (*midi_view(), &MidiStreamView::suspend_updates)); _range_scroomer->DragFinishing.connect (sigc::mem_fun (*midi_view(), &MidiStreamView::resume_updates)); - controls_hbox.pack_start(*_range_scroomer); + /* Put the scroomer in a VBox with a padding label so that it can be reduced in height + for stacked-view tracks. + */ + VBox* b = manage (new VBox); + b->pack_start (*_range_scroomer, false, false); + b->pack_start (*manage (new Label ("")), true, true); + controls_hbox.pack_start(*b); controls_hbox.pack_start(*_piano_roll_header); controls_ebox.set_name ("MidiTrackControlsBaseUnselected"); @@ -1227,3 +1234,8 @@ MidiTimeAxisView::note_range_changed () set_gui_property ("note-range-max", (int) midi_view()->highest_note ()); } +void +MidiTimeAxisView::contents_height_changed () +{ + _range_scroomer->set_size_request (-1, _view->child_height ()); +} |