From afa6a1a1d9edc25f4fb2ac4b2ef113382801ac5b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 15 Feb 2000 16:28:54 +0000 Subject: [PATCH] text bg is transparent now, but the icons are still not git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectrl.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index 656560dec3..0f45e548b7 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -1523,6 +1523,13 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) 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 ) @@ -1535,10 +1542,7 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) 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)); -- 2.50.0