Kicad manager: fix incorrect handling of disabled state of tools in launcher toolbar

This commit is contained in:
jean-pierre charras 2019-07-24 18:03:13 +02:00
parent 79934a327e
commit 9e90cb9572
3 changed files with 16 additions and 3 deletions

View File

@ -67,7 +67,15 @@ void ACTION_TOOLBAR::AddButton( const TOOL_ACTION& aAction )
void ACTION_TOOLBAR::SetToolBitmap( const TOOL_ACTION& aAction, const wxBitmap& aBitmap )
{
wxAuiToolBar::SetToolBitmap( aAction.GetId() + ACTION_ID, aBitmap );
int toolId = aAction.GetId() + ACTION_ID;
wxAuiToolBar::SetToolBitmap( toolId, aBitmap );
// Set the disabled bitmap: we use the disabled bitmap version
// of aBitmap.
wxAuiToolBarItem* tb_item = wxAuiToolBar::FindTool( toolId );
if( tb_item )
tb_item->SetDisabledBitmap( aBitmap.ConvertToDisabled() );
}

View File

@ -326,6 +326,8 @@ void KICAD_MANAGER_FRAME::LoadProject( const wxFileName& aProjectFileName )
m_leftWin->ReCreateTreePrj();
SyncToolbars();
// Rebuild the list of watched paths.
// however this is possible only when the main loop event handler is running,
// so we use it to run the rebuild function.

View File

@ -224,7 +224,7 @@ void KICAD_MANAGER_FRAME::RecreateLauncher()
m_launcher->Add( KICAD_MANAGER_ACTIONS::showCalculator );
m_launcher->Add( KICAD_MANAGER_ACTIONS::editWorksheet );
// Now stt big icons for these tools:
// Now set big icons for these tools:
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::editSchematic,
KiScaledBitmap( icon_eeschema_xpm, this ) );
m_launcher->SetToolBitmap( KICAD_MANAGER_ACTIONS::editSymbols,
@ -244,6 +244,9 @@ void KICAD_MANAGER_FRAME::RecreateLauncher()
// Create mlauncher
m_launcher->Realize();
// And update the visual tools state:
SyncToolbars();
}