]> git.saurik.com Git - wxWidgets.git/commitdiff
only use our background for children if it's inheritable
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 Dec 2004 20:39:36 +0000 (20:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 19 Dec 2004 20:39:36 +0000 (20:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 65fafd055a687fea2aaf7462648fe12958281095..90fffdc037e0d41e3a46b2d0ca887d63126f0620 100644 (file)
@@ -4048,7 +4048,7 @@ WXHBRUSH wxWindowMSW::MSWGetSolidBgBrushForChild(wxWindow *child)
 
 wxColour wxWindowMSW::MSWGetBgColourForChild(wxWindow * WXUNUSED(child))
 {
-    return m_hasBgCol ? GetBackgroundColour() : wxNullColour;
+    return m_inheritBgCol ? GetBackgroundColour() : wxNullColour;
 }
 
 WXHBRUSH wxWindowMSW::MSWGetBgBrushForSelf(wxWindow *parent, WXHDC hDC)
@@ -4060,13 +4060,14 @@ WXHBRUSH wxWindowMSW::MSWGetBgBrush(WXHDC hDC)
 {
     for ( wxWindow *win = (wxWindow *)this; win; win = win->GetParent() )
     {
-        // background is not inherited beyond the containing TLW
-        if ( win->IsTopLevel() )
-            break;
-
         WXHBRUSH hBrush = MSWGetBgBrushForSelf(win, hDC);
         if ( hBrush )
             return hBrush;
+
+        // background is not inherited beyond the windows which have their own
+        // fixed background such as top level windows and notebooks
+        if ( win->IsTopLevel() /* ProvidesBackground() */ )
+            break;
     }
 
     return 0;