Improve appearance of tools using bitmaps with alpha in wxMSW wxToolBar.

Use alpha in the combined toolbar bitmap if any of its tools has a bitmap
using alpha. This greatly improves the appearance of the automatically
generated disabled images for the tools with bitmaps using alpha.

See #15876.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-01-19 13:16:02 +00:00
parent 0824752236
commit 7ded29f297

View File

@ -783,6 +783,12 @@ bool wxToolBar::Realize()
if ( bmp.IsOk() )
{
// By default bitmaps don't have alpha in wxMSW, but if we
// use a bitmap tool with alpha, we should use alpha for
// the combined bitmap as well.
if ( bmp.HasAlpha() )
bitmap.UseAlpha();
int xOffset = wxMax(0, (m_defaultWidth - w)/2);
int yOffset = wxMax(0, (m_defaultHeight - h)/2);