]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectrl.cpp
text bg is transparent now, but the icons are still not
[wxWidgets.git] / src / generic / treectrl.cpp
index 656560dec35e9259d4dd3c9a597852ab325ddcfa..0f45e548b7c38fa01250cd9ed5b4b0c1babf82e6 100644 (file)
@@ -1523,6 +1523,13 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
 
     int total_h = GetLineHeight(item);
 
 
     int total_h = GetLineHeight(item);
 
+    wxColour colBg;
+    if ( attr && attr->HasBackgroundColour() )
+        colBg = attr->GetBackgroundColour();
+    else
+        colBg = m_backgroundColour;
+    dc.SetBrush(wxBrush(colBg, wxSOLID));
+
     dc.DrawRectangle( item->GetX()-2, item->GetY(), item->GetWidth()+2, total_h );
 
     if ( image != NO_IMAGE )
     dc.DrawRectangle( item->GetX()-2, item->GetY(), item->GetWidth()+2, total_h );
 
     if ( image != NO_IMAGE )
@@ -1535,10 +1542,7 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
         dc.DestroyClippingRegion();
     }
 
         dc.DestroyClippingRegion();
     }
 
-    bool hasBgCol = attr && attr->HasBackgroundColour();
-    dc.SetBackgroundMode(hasBgCol ? wxSOLID : wxTRANSPARENT);
-    if ( hasBgCol )
-        dc.SetTextBackground(attr->GetBackgroundColour());
+    dc.SetBackgroundMode(wxTRANSPARENT);
     dc.DrawText( item->GetText(), image_w + item->GetX(), item->GetY()
                  + ((total_h > text_h) ? (total_h - text_h)/2 : 0));
 
     dc.DrawText( item->GetText(), image_w + item->GetX(), item->GetY()
                  + ((total_h > text_h) ? (total_h - text_h)/2 : 0));