From f59a5125459324a04d0ff94f778867e86d70122d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 19 Aug 2025 14:03:10 +0200 Subject: [PATCH] Tweak editor bottom pane packing, never unpack the property box --- gtk2_ardour/editor.cc | 3 +++ gtk2_ardour/editor_selection.cc | 34 ++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index e02212aaa7..e12516dfe3 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -537,6 +537,9 @@ Editor::Editor () _locations = new EditorLocations (*this); _properties_box = new SelectionPropertiesBox (); + _bottom_hbox.pack_start (*_properties_box, true, true); + _properties_box->show (); + /* these are static location signals */ Location::start_changed.connect (*this, invalidator (*this), std::bind (&Editor::location_changed, this, _1), gui_context()); diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 02495eb93c..fa07be1d2c 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1721,27 +1721,21 @@ Editor::region_selection_changed () assert (rv); maybe_edit_region_in_bottom_pane (*rv); } else { - Gtkmm2ext::container_clear (_bottom_hbox); - _bottom_hbox.pack_start (*_properties_box, true, true); - _properties_box->show (); + gtk_box_set_child_packing (GTK_BOX(_bottom_hbox.gobj()), GTK_WIDGET(_properties_box->gobj()), true, true, 0, GTK_PACK_START); + if (_pianoroll->contents().get_parent()) { + _pianoroll->contents().unmap (); + _pianoroll->contents().get_parent()->remove (_pianoroll->contents()); + } } } void 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; MidiRegionView* mrv = dynamic_cast (&rv); - if (mrv) { + if (mrv && UIConfiguration::instance().get_region_edit_disposition() != Editing::NeverBottomPane) { std::shared_ptr mt = std::dynamic_pointer_cast (mrv->midi_view()->track()); std::shared_ptr mr = std::dynamic_pointer_cast(mrv->region()); if (mrv && mt && mr) { @@ -1752,14 +1746,18 @@ Editor::maybe_edit_region_in_bottom_pane (RegionView& rv) } if (pack_pianoroll) { - _bottom_hbox.pack_start (*_properties_box, false, false); - _bottom_hbox.pack_start (_pianoroll->contents(), true, true); - _pianoroll->contents().hide (); + gtk_box_set_child_packing (GTK_BOX(_bottom_hbox.gobj()), GTK_WIDGET(_properties_box->gobj()), false, false, 0, GTK_PACK_START); + if (!_pianoroll->contents().get_parent()) { + _bottom_hbox.pack_start (_pianoroll->contents(), true, true); + } + _pianoroll->contents().hide (); // Why is this needed? _pianoroll->contents().show_all (); - _properties_box->show (); } else { - _bottom_hbox.pack_start (*_properties_box, true, true); - _properties_box->show (); + if (_pianoroll->contents().get_parent()) { + _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); } }