only remap the disabled bitmap of a toolbarbutton when allowed by system (settings), otherwise colour artifacts can appear

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2005-11-15 23:26:06 +00:00
parent 6716099174
commit 0f99ce3d75

View File

@@ -679,17 +679,20 @@ bool wxToolBar::Realize()
wxImage imgGreyed; wxImage imgGreyed;
wxCreateGreyedImage(bmp.ConvertToImage(), imgGreyed); wxCreateGreyedImage(bmp.ConvertToImage(), imgGreyed);
// we need to have light grey background colour for if (doRemap)
// MapBitmap() to work correctly
for ( int y = 0; y < h; y++ )
{ {
for ( int x = 0; x < w; x++ ) // we need to have light grey background colour for
// MapBitmap() to work correctly
for ( int y = 0; y < h; y++ )
{ {
if ( imgGreyed.IsTransparent(x, y) ) for ( int x = 0; x < w; x++ )
imgGreyed.SetRGB(x, y, {
wxLIGHT_GREY->Red(), if ( imgGreyed.IsTransparent(x, y) )
wxLIGHT_GREY->Green(), imgGreyed.SetRGB(x, y,
wxLIGHT_GREY->Blue()); wxLIGHT_GREY->Red(),
wxLIGHT_GREY->Green(),
wxLIGHT_GREY->Blue());
}
} }
} }
@@ -697,7 +700,10 @@ bool wxToolBar::Realize()
} }
#endif // wxUSE_IMAGE #endif // wxUSE_IMAGE
MapBitmap(bmpDisabled.GetHBITMAP(), w, h); if (doRemap)
{
MapBitmap(bmpDisabled.GetHBITMAP(), w, h);
}
m_disabledImgList->Add(bmpDisabled); m_disabledImgList->Add(bmpDisabled);
} }