Adjust pad sub-menu enablements
The apply settings and push settings options now take account of the validity of the global pad settings when deciding whether to show or not. Global pad push now requires a source pad and doesn't push from the global pad setting when there is no selection. The whole submenu is hidden when there are no enabled items. Fixes: lp:1664016 * https://bugs.launchpad.net/kicad/+bug/1664016
This commit is contained in:
committed by
Maciej Suminski
parent
6164b9be2a
commit
ca91c27852
@@ -187,6 +187,25 @@ void CONTEXT_MENU::Clear()
|
||||
}
|
||||
|
||||
|
||||
bool CONTEXT_MENU::HasEnabledItems() const
|
||||
{
|
||||
bool hasEnabled = false;
|
||||
|
||||
auto& items = GetMenuItems();
|
||||
|
||||
for( auto item : items )
|
||||
{
|
||||
if( item->IsEnabled() && !item->IsSeparator() )
|
||||
{
|
||||
hasEnabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return hasEnabled;
|
||||
}
|
||||
|
||||
|
||||
void CONTEXT_MENU::UpdateAll()
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user