diff --git a/docs/changes.txt b/docs/changes.txt index e19965a134..0b86119d64 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -160,6 +160,7 @@ wxGTK: wxUniv: - Fix wxTextCtrl::SetSelection(-1, -1) to behave as documented (Anders Larsen) +- Fix setting background colour for controls with transparent background 2.8.3 diff --git a/src/univ/stattext.cpp b/src/univ/stattext.cpp index ea5d42a206..f854398a17 100644 --- a/src/univ/stattext.cpp +++ b/src/univ/stattext.cpp @@ -83,14 +83,6 @@ wxSize wxStaticText::DoGetBestClientSize() const void wxStaticText::DoDraw(wxControlRenderer *renderer) { - if ( UseBgCol() ) - { - wxDC& dc = renderer->GetDC(); - dc.SetBrush(GetBackgroundColour()); - dc.SetPen(*wxTRANSPARENT_PEN); - dc.DrawRectangle(renderer->GetRect()); - } - renderer->DrawLabel(); } diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 6a03329594..90bb87c58f 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -359,7 +359,7 @@ bool wxWindow::DoDrawBackground(wxDC& dc) rect.height = size.y; wxWindow * const parent = GetParent(); - if ( HasTransparentBackground() && parent ) + if ( HasTransparentBackground() && !UseBgCol() && parent ) { wxASSERT( !IsTopLevel() );