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,6 +679,8 @@ bool wxToolBar::Realize()
wxImage imgGreyed; wxImage imgGreyed;
wxCreateGreyedImage(bmp.ConvertToImage(), imgGreyed); wxCreateGreyedImage(bmp.ConvertToImage(), imgGreyed);
if (doRemap)
{
// we need to have light grey background colour for // we need to have light grey background colour for
// MapBitmap() to work correctly // MapBitmap() to work correctly
for ( int y = 0; y < h; y++ ) for ( int y = 0; y < h; y++ )
@@ -692,12 +694,16 @@ bool wxToolBar::Realize()
wxLIGHT_GREY->Blue()); wxLIGHT_GREY->Blue());
} }
} }
}
bmpDisabled = wxBitmap(imgGreyed); bmpDisabled = wxBitmap(imgGreyed);
} }
#endif // wxUSE_IMAGE #endif // wxUSE_IMAGE
if (doRemap)
{
MapBitmap(bmpDisabled.GetHBITMAP(), w, h); MapBitmap(bmpDisabled.GetHBITMAP(), w, h);
}
m_disabledImgList->Add(bmpDisabled); m_disabledImgList->Add(bmpDisabled);
} }