]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing custom background on non owned windows
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 26 Mar 2008 10:54:09 +0000 (10:54 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 26 Mar 2008 10:54:09 +0000 (10:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52830 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/nonownedwnd.cpp

index 1a1adedf1043d2de83ee814144c56c35a77095fa..2489f1022c2414782177ffc1ad11d8603f2c6b7f 100644 (file)
@@ -898,19 +898,18 @@ bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c )
     if ( !wxWindow::SetBackgroundColour(col) && m_hasBgCol )
         return false ;
     
-    if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) )
+    if ( GetBackgroundStyle() != wxBG_STYLE_CUSTOM )
     {
-        SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDocumentWindowBackground, false ) ;
-        SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-    }
-    else if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) )
-    {
-        SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDialogBackgroundActive, false ) ;
-        SetBackgroundStyle(wxBG_STYLE_CUSTOM);
-    }
-    else
-    {
-        SetBackgroundStyle(wxBG_STYLE_COLOUR);
+        if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) )
+        {
+            SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDocumentWindowBackground, false ) ;
+            SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        }
+        else if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) )
+        {
+            SetThemeWindowBackground( (WindowRef) m_macWindow,  kThemeBrushDialogBackgroundActive, false ) ;
+            SetBackgroundStyle(wxBG_STYLE_SYSTEM);
+        }
     }
     return true;
 }