summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/midi_scroomer.cc8
-rw-r--r--gtk2_ardour/midi_scroomer.h1
-rw-r--r--gtk2_ardour/midi_time_axis.cc16
-rw-r--r--gtk2_ardour/midi_time_axis.h1
-rw-r--r--gtk2_ardour/streamview.cc2
-rw-r--r--gtk2_ardour/streamview.h2
6 files changed, 19 insertions, 11 deletions
diff --git a/gtk2_ardour/midi_scroomer.cc b/gtk2_ardour/midi_scroomer.cc
index cccc03c507..c3295c8f73 100644
--- a/gtk2_ardour/midi_scroomer.cc
+++ b/gtk2_ardour/midi_scroomer.cc
@@ -165,12 +165,4 @@ void
MidiScroomer::on_size_request(Gtk::Requisition* r)
{
r->width = 12;
- r->height = 100;
}
-
-void
-MidiScroomer::on_size_allocate(Gtk::Allocation& a)
-{
- Scroomer::on_size_allocate(a);
-}
-
diff --git a/gtk2_ardour/midi_scroomer.h b/gtk2_ardour/midi_scroomer.h
index 5f758c727d..b27c66dbe9 100644
--- a/gtk2_ardour/midi_scroomer.h
+++ b/gtk2_ardour/midi_scroomer.h
@@ -30,7 +30,6 @@ class MidiScroomer : public Gtkmm2ext::Scroomer {
bool on_expose_event(GdkEventExpose*);
void on_size_request(Gtk::Requisition*);
- void on_size_allocate(Gtk::Allocation&);
void get_colors(double color[], Component comp);
};
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 ());
+}
diff --git a/gtk2_ardour/midi_time_axis.h b/gtk2_ardour/midi_time_axis.h
index 356a2474db..4da89df109 100644
--- a/gtk2_ardour/midi_time_axis.h
+++ b/gtk2_ardour/midi_time_axis.h
@@ -118,6 +118,7 @@ class MidiTimeAxisView : public RouteTimeAxisView
void route_active_changed ();
void note_range_changed ();
+ void contents_height_changed ();
bool _ignore_signals;
MidiScroomer* _range_scroomer;
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index f72b464d80..19f6ee65bb 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -613,6 +613,8 @@ StreamView::update_contents_height ()
break;
}
}
+
+ ContentsHeightChanged (); /* EMIT SIGNAL */
}
void
diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h
index 0d15a5d7d7..49001f57f6 100644
--- a/gtk2_ardour/streamview.h
+++ b/gtk2_ardour/streamview.h
@@ -122,6 +122,8 @@ public:
sigc::signal<void, RegionView*> RegionViewAdded;
sigc::signal<void> RegionViewRemoved;
+ /** Emitted when the height of regions has changed */
+ sigc::signal<void> ContentsHeightChanged;
protected:
StreamView (RouteTimeAxisView&, ArdourCanvas::Group* background_group = 0, ArdourCanvas::Group* canvas_group = 0);