]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes fo inheriting colours set with SetOwnBackround()
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 22 Dec 2004 21:09:01 +0000 (21:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 22 Dec 2004 21:09:01 +0000 (21:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index b5f9bec74a90463caed3c11671799329139fbaf4..e56b767ca4746bfe90879ea1d17f83e3f3174aff 100644 (file)
@@ -4050,7 +4050,7 @@ WXHBRUSH wxWindowMSW::MSWGetSolidBgBrushForChild(wxWindow *child)
 
 wxColour wxWindowMSW::MSWGetBgColourForChild(wxWindow * WXUNUSED(child))
 {
-    return m_inheritBgCol ? GetBackgroundColour() : wxNullColour;
+    return m_hasBgCol ? GetBackgroundColour() : wxNullColour;
 }
 
 WXHBRUSH wxWindowMSW::MSWGetBgBrushForSelf(wxWindow *parent, WXHDC hDC)
@@ -4067,8 +4067,11 @@ WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC)
             return hBrush;
 
         // background is not inherited beyond the windows which have their own
-        // fixed background such as top level windows and notebooks
-        if ( win->ProvidesBackground() )
+        // fixed background such as top level windows and notebooks and for
+        // windows for which a custom colour had been explicitly set with
+        // SetOwnBackgroundColour() and so shouldn't affect its children
+        if ( win->ProvidesBackground() ||
+                (win->m_hasBgCol && !win->m_inheritBgCol) )
             break;
     }