13
0

rationalize where a TimeAxisView::_size_menu is detached from its parent menu

This happens before the parent menu is deleted and rebuilt
This commit is contained in:
Paul Davis 2021-05-13 10:26:20 -06:00
parent 03db585f24
commit 95c674e3be
3 changed files with 9 additions and 6 deletions

View File

@ -632,6 +632,10 @@ RouteTimeAxisView::build_display_menu ()
/* prepare it */
if (automation_action_menu) {
detach_menu (*automation_action_menu);
}
TimeAxisView::build_display_menu ();
/* now fill it with our stuff */
@ -649,9 +653,6 @@ RouteTimeAxisView::build_display_menu ()
items.push_back (SeparatorElem());
if (_size_menu) {
detach_menu (*_size_menu);
}
build_size_menu ();
items.push_back (MenuElem (_("Height"), *_size_menu));
items.push_back (SeparatorElem());

View File

@ -807,6 +807,10 @@ TimeAxisView::build_display_menu ()
{
using namespace Menu_Helpers;
if (_size_menu) {
Gtkmm2ext::detach_menu (*_size_menu);
}
delete display_menu;
display_menu = new Menu;

View File

@ -451,9 +451,7 @@ VCATimeAxisView::build_display_menu ()
MenuList& items = display_menu->items();
items.push_back (MenuElem (_("Color..."), sigc::mem_fun (*this, &VCATimeAxisView::choose_color)));
if (_size_menu) {
detach_menu (*_size_menu);
}
build_size_menu ();
items.push_back (MenuElem (_("Height"), *_size_menu));
items.push_back (SeparatorElem());