From 7ded29f297618de14bd046ba0afdd0a5621398ac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Jan 2014 13:16:02 +0000 Subject: [PATCH] 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 --- src/msw/toolbar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 48a2f3afed..2f4aa7911a 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -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);