From: Vadim Zeitlin Date: Thu, 24 Mar 2011 16:08:11 +0000 (+0000) Subject: Set m_inheritBgCol flag in wxPanel with a background bitmap. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/af2fdacdb83b11cf09899fa2a522efbbededc004 Set m_inheritBgCol flag in wxPanel with a background bitmap. This ensures that the panel background is used by its transparent children under wxMSW even when the panel itself is inside a wxNotebook with themed background: making InheritsBackgroundColour() return true prevents the notebook from overriding our background. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/panel.cpp b/src/msw/panel.cpp index 5dc1bfcf5a..e5b57eeb3a 100644 --- a/src/msw/panel.cpp +++ b/src/msw/panel.cpp @@ -51,6 +51,11 @@ void wxPanel::DoSetBackgroundBitmap(const wxBitmap& bmp) { delete m_backgroundBrush; m_backgroundBrush = bmp.IsOk() ? new wxBrush(bmp) : NULL; + + // Our transparent children should use our background if we have it, + // otherwise try to restore m_inheritBgCol to some reasonable value: true + // if we also have non-default background colour or false otherwise. + m_inheritBgCol = bmp.IsOk() || UseBgCol(); } WXHBRUSH wxPanel::MSWGetCustomBgBrush()