Allow checkboxes in Windows with/without bitmaps

Fixes https://gitlab.com/kicad/code/kicad/issues/6675
This commit is contained in:
Seth Hillbrand 2020-12-08 16:14:06 -08:00
parent 4bed8bd57a
commit c87a1ca17a
1 changed files with 2 additions and 15 deletions

View File

@ -211,22 +211,9 @@ void AddBitmapToMenuItem( wxMenuItem* aMenu, const wxBitmap& aImage )
wxItemKind menu_type = aMenu->GetKind();
if( useImagesInMenus )
if( useImagesInMenus && menu_type != wxITEM_CHECK && menu_type != wxITEM_RADIO )
{
if( menu_type == wxITEM_CHECK || menu_type == wxITEM_RADIO )
{
#if defined( __WINDOWS__ )
aMenu->SetBitmaps( KiBitmap( checked_ok_xpm ), aImage );
// A workaround to a strange bug on Windows, wx Widgets 3.0:
// size of bitmaps is not taken in account for wxITEM_{CHECK,RADIO} menu
// unless we call SetFont
aMenu->SetFont( *wxNORMAL_FONT );
#endif
}
else if( menu_type != wxITEM_RADIO )
{
aMenu->SetBitmap( aImage );
}
aMenu->SetBitmap( aImage );
}
}