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
This commit is contained in:
parent
5c60eea32a
commit
4a174039ae
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
|
|
@ -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 ());
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -613,6 +613,8 @@ StreamView::update_contents_height ()
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ContentsHeightChanged (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user