Fix layout of selection property box w/pianoroll
Shrink properties IFF pianroll is visible, expand pianroll whenever it is visible.
This commit is contained in:
@@ -1255,12 +1255,12 @@ Editor::set_session (Session *t)
|
||||
if (!_pianoroll) {
|
||||
// XXX this should really not happen here
|
||||
_pianoroll = new Pianoroll ("editor pianoroll");
|
||||
_pianoroll->viewport().set_size_request (600, 120);
|
||||
_pianoroll->viewport().set_size_request (-1, 120);
|
||||
}
|
||||
_pianoroll->set_session (_session);
|
||||
|
||||
_bottom_hbox.pack_start(*_properties_box, true, true);
|
||||
_bottom_hbox.pack_start(_pianoroll->contents(), true, true);
|
||||
/* _pianoroll is packed on demand in Editor::region_selection_changed */
|
||||
_bottom_hbox.show_all();
|
||||
|
||||
if (rhythm_ferret) {
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "keyboard.h"
|
||||
#include "midi_region_view.h"
|
||||
#include "pianoroll.h"
|
||||
#include "selection_properties_box.h"
|
||||
#include "sfdb_ui.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
@@ -1715,7 +1716,7 @@ Editor::region_selection_changed ()
|
||||
}
|
||||
update_selection_markers ();
|
||||
|
||||
_pianoroll->contents().hide ();
|
||||
bool pack_pianoroll = false;
|
||||
if (selection->regions.size () == 1) {
|
||||
RegionView* rv = (selection->regions.front ());
|
||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (rv);
|
||||
@@ -1725,10 +1726,20 @@ Editor::region_selection_changed ()
|
||||
if (mrv && mt && mr) {
|
||||
_pianoroll->set_track (mt);
|
||||
_pianoroll->set_region (mr);
|
||||
_pianoroll->contents().show ();
|
||||
pack_pianoroll = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Gtkmm2ext::container_clear (_bottom_hbox);
|
||||
if (pack_pianoroll) {
|
||||
_bottom_hbox.pack_start(*_properties_box, false, false);
|
||||
_bottom_hbox.pack_start(_pianoroll->contents(), true, true);
|
||||
_pianoroll->contents().hide ();
|
||||
_pianoroll->contents().show_all ();
|
||||
} else {
|
||||
_bottom_hbox.pack_start(*_properties_box, true, true);
|
||||
}
|
||||
_properties_box->show ();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -180,6 +180,7 @@ SelectionPropertiesBox::selection_changed ()
|
||||
|
||||
_region_fx_box = new RegionFxPropertiesBox (rv->region ());
|
||||
_region_editor_box.pack_start (*_region_fx_box);
|
||||
_region_editor_box.show ();
|
||||
rv->RegionViewGoingAway.connect_same_thread (_region_connection, std::bind (&SelectionPropertiesBox::delete_region_editor, this));
|
||||
}
|
||||
_region_editor_box.show ();
|
||||
|
||||
Reference in New Issue
Block a user