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:
parent
6716099174
commit
0f99ce3d75
@ -679,17 +679,20 @@ bool wxToolBar::Realize()
|
||||
wxImage imgGreyed;
|
||||
wxCreateGreyedImage(bmp.ConvertToImage(), imgGreyed);
|
||||
|
||||
// we need to have light grey background colour for
|
||||
// MapBitmap() to work correctly
|
||||
for ( int y = 0; y < h; y++ )
|
||||
if (doRemap)
|
||||
{
|
||||
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) )
|
||||
imgGreyed.SetRGB(x, y,
|
||||
wxLIGHT_GREY->Red(),
|
||||
wxLIGHT_GREY->Green(),
|
||||
wxLIGHT_GREY->Blue());
|
||||
for ( int x = 0; x < w; x++ )
|
||||
{
|
||||
if ( imgGreyed.IsTransparent(x, y) )
|
||||
imgGreyed.SetRGB(x, y,
|
||||
wxLIGHT_GREY->Red(),
|
||||
wxLIGHT_GREY->Green(),
|
||||
wxLIGHT_GREY->Blue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -697,7 +700,10 @@ bool wxToolBar::Realize()
|
||||
}
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
MapBitmap(bmpDisabled.GetHBITMAP(), w, h);
|
||||
if (doRemap)
|
||||
{
|
||||
MapBitmap(bmpDisabled.GetHBITMAP(), w, h);
|
||||
}
|
||||
|
||||
m_disabledImgList->Add(bmpDisabled);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user