Add a hack to keep OSX from hijacking our help menu.

For some reason once a player is opened from the Kicad Manager window
all the items under the help menu get grayed out.  This prevents that
from happening.
This commit is contained in:
Jeff Young 2021-09-06 12:43:48 +01:00
parent f9417c6584
commit 0321e55f0b
2 changed files with 6 additions and 12 deletions

View File

@ -452,7 +452,8 @@ void EDA_BASE_FRAME::AddStandardHelpMenu( wxMenuBar* aMenuBar )
helpMenu->AppendSeparator(); helpMenu->AppendSeparator();
helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, BITMAPS::about ); helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, BITMAPS::about );
aMenuBar->Append( helpMenu, _( "&Help" ) ); // Trailing space keeps OSX from hijacking our menu (and disabling everything in it).
aMenuBar->Append( helpMenu, _( "&Help" ) + wxS( " " ) );
} }

View File

@ -252,20 +252,13 @@ void ACTION_MENU::Clear()
bool ACTION_MENU::HasEnabledItems() const bool ACTION_MENU::HasEnabledItems() const
{ {
bool hasEnabled = false; for( wxMenuItem* item : GetMenuItems() )
auto& items = GetMenuItems();
for( auto item : items )
{ {
if( item->IsEnabled() && !item->IsSeparator() ) if( item->IsEnabled() && !item->IsSeparator() )
{ return true;
hasEnabled = true;
break;
}
} }
return hasEnabled; return false;
} }
@ -339,7 +332,7 @@ void ACTION_MENU::updateHotKeys()
{ {
TOOL_MANAGER* toolMgr = getToolManager(); TOOL_MANAGER* toolMgr = getToolManager();
for( auto& ii : m_toolActions ) for( std::pair<const int, const TOOL_ACTION*>& ii : m_toolActions )
{ {
int id = ii.first; int id = ii.first;
const TOOL_ACTION& action = *ii.second; const TOOL_ACTION& action = *ii.second;