Recursively call evaluate on submenus of conditional menus
There seems to be a bug with certain GTK setups that prevents the submenus from getting sized correctly unless the elements are added when the main menu is displayed. Fixes: lp:1835460 * https://bugs.launchpad.net/kicad/+bug/1835460
This commit is contained in:
parent
5c85dbaec4
commit
05429bc39c
|
@ -197,6 +197,18 @@ void CONDITIONAL_MENU::Evaluate( SELECTION& aSelection )
|
|||
menuItem->Enable( result );
|
||||
}
|
||||
}
|
||||
|
||||
// Recursively call Evaluate on all the submenus that are CONDITIONAL_MENUs to ensure
|
||||
// they are updated. This is also required on GTK to make sure the menus have the proper
|
||||
// size when created.
|
||||
runOnSubmenus(
|
||||
[&aSelection]( ACTION_MENU* aMenu )
|
||||
{
|
||||
CONDITIONAL_MENU* conditionalMenu = dynamic_cast<CONDITIONAL_MENU*>( aMenu );
|
||||
|
||||
if( conditionalMenu )
|
||||
conditionalMenu->Evaluate( aSelection );
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue