Fix icon-scaling issue for ACTION_TOOLBAR.

Fixes: lp:1829291
* https://bugs.launchpad.net/kicad/+bug/1829291
This commit is contained in:
Jeff Young 2019-05-16 19:54:05 +01:00
parent fbb807f3bb
commit b4d4525496
1 changed files with 3 additions and 2 deletions

View File

@ -41,10 +41,11 @@ ACTION_TOOLBAR::ACTION_TOOLBAR( EDA_DRAW_FRAME* parent, wxWindowID id, const wxP
void ACTION_TOOLBAR::Add( const TOOL_ACTION& aAction, bool aIsToggleEntry ) void ACTION_TOOLBAR::Add( const TOOL_ACTION& aAction, bool aIsToggleEntry )
{ {
EDA_DRAW_FRAME* editFrame = m_toolManager->GetEditFrame();
int toolId = aAction.GetId() + ACTION_ID; int toolId = aAction.GetId() + ACTION_ID;
AddTool( toolId, wxEmptyString, KiBitmap( aAction.GetIcon() ), aAction.GetDescription(), AddTool( toolId, wxEmptyString, KiScaledBitmap( aAction.GetIcon(), editFrame ),
aIsToggleEntry ? wxITEM_CHECK : wxITEM_NORMAL ); aAction.GetDescription(), aIsToggleEntry ? wxITEM_CHECK : wxITEM_NORMAL );
m_toolKinds[ toolId ] = aIsToggleEntry; m_toolKinds[ toolId ] = aIsToggleEntry;
m_toolActions[ toolId ] = &aAction; m_toolActions[ toolId ] = &aAction;