mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 21:56:30 +01:00
Tweak editor bottom pane packing, never unpack the property box
This commit is contained in:
parent
7d4350ab25
commit
f59a512545
2 changed files with 19 additions and 18 deletions
|
|
@ -537,6 +537,9 @@ Editor::Editor ()
|
||||||
_locations = new EditorLocations (*this);
|
_locations = new EditorLocations (*this);
|
||||||
_properties_box = new SelectionPropertiesBox ();
|
_properties_box = new SelectionPropertiesBox ();
|
||||||
|
|
||||||
|
_bottom_hbox.pack_start (*_properties_box, true, true);
|
||||||
|
_properties_box->show ();
|
||||||
|
|
||||||
/* these are static location signals */
|
/* these are static location signals */
|
||||||
|
|
||||||
Location::start_changed.connect (*this, invalidator (*this), std::bind (&Editor::location_changed, this, _1), gui_context());
|
Location::start_changed.connect (*this, invalidator (*this), std::bind (&Editor::location_changed, this, _1), gui_context());
|
||||||
|
|
|
||||||
|
|
@ -1721,27 +1721,21 @@ Editor::region_selection_changed ()
|
||||||
assert (rv);
|
assert (rv);
|
||||||
maybe_edit_region_in_bottom_pane (*rv);
|
maybe_edit_region_in_bottom_pane (*rv);
|
||||||
} else {
|
} else {
|
||||||
Gtkmm2ext::container_clear (_bottom_hbox);
|
gtk_box_set_child_packing (GTK_BOX(_bottom_hbox.gobj()), GTK_WIDGET(_properties_box->gobj()), true, true, 0, GTK_PACK_START);
|
||||||
_bottom_hbox.pack_start (*_properties_box, true, true);
|
if (_pianoroll->contents().get_parent()) {
|
||||||
_properties_box->show ();
|
_pianoroll->contents().unmap ();
|
||||||
|
_pianoroll->contents().get_parent()->remove (_pianoroll->contents());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::maybe_edit_region_in_bottom_pane (RegionView& rv)
|
Editor::maybe_edit_region_in_bottom_pane (RegionView& rv)
|
||||||
{
|
{
|
||||||
Gtkmm2ext::container_clear (_bottom_hbox);
|
|
||||||
|
|
||||||
if (UIConfiguration::instance().get_region_edit_disposition() == Editing::NeverBottomPane) {
|
|
||||||
_bottom_hbox.pack_start (*_properties_box, true, true);
|
|
||||||
_properties_box->show ();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool pack_pianoroll = false;
|
bool pack_pianoroll = false;
|
||||||
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (&rv);
|
MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (&rv);
|
||||||
|
|
||||||
if (mrv) {
|
if (mrv && UIConfiguration::instance().get_region_edit_disposition() != Editing::NeverBottomPane) {
|
||||||
std::shared_ptr<ARDOUR::MidiTrack> mt = std::dynamic_pointer_cast<ARDOUR::MidiTrack> (mrv->midi_view()->track());
|
std::shared_ptr<ARDOUR::MidiTrack> mt = std::dynamic_pointer_cast<ARDOUR::MidiTrack> (mrv->midi_view()->track());
|
||||||
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion>(mrv->region());
|
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion>(mrv->region());
|
||||||
if (mrv && mt && mr) {
|
if (mrv && mt && mr) {
|
||||||
|
|
@ -1752,14 +1746,18 @@ Editor::maybe_edit_region_in_bottom_pane (RegionView& rv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pack_pianoroll) {
|
if (pack_pianoroll) {
|
||||||
_bottom_hbox.pack_start (*_properties_box, false, false);
|
gtk_box_set_child_packing (GTK_BOX(_bottom_hbox.gobj()), GTK_WIDGET(_properties_box->gobj()), false, false, 0, GTK_PACK_START);
|
||||||
_bottom_hbox.pack_start (_pianoroll->contents(), true, true);
|
if (!_pianoroll->contents().get_parent()) {
|
||||||
_pianoroll->contents().hide ();
|
_bottom_hbox.pack_start (_pianoroll->contents(), true, true);
|
||||||
|
}
|
||||||
|
_pianoroll->contents().hide (); // Why is this needed?
|
||||||
_pianoroll->contents().show_all ();
|
_pianoroll->contents().show_all ();
|
||||||
_properties_box->show ();
|
|
||||||
} else {
|
} else {
|
||||||
_bottom_hbox.pack_start (*_properties_box, true, true);
|
if (_pianoroll->contents().get_parent()) {
|
||||||
_properties_box->show ();
|
_pianoroll->contents().unmap ();
|
||||||
|
_pianoroll->contents().get_parent()->remove (_pianoroll->contents());
|
||||||
|
}
|
||||||
|
gtk_box_set_child_packing (GTK_BOX(_bottom_hbox.gobj()), GTK_WIDGET(_properties_box->gobj()), true, true, 0, GTK_PACK_START);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue