From 0a3c4e03f4ec1920a69209aba7d1c6ba51ae1d10 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Apr 2007 01:17:28 +0000 Subject: [PATCH] even controls with transparent background should draw it if they have an explicitly set background colour, so handle this at wxWindowUniv level instead of adding hacks to individual controls, such as wxStaticText, to deal with this (replaces patch 1700004) [backport from HEAD] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@45447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/univ/stattext.cpp | 8 -------- src/univ/winuniv.cpp | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index bfd797a653..8d5208f407 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -117,6 +117,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 83ebf31eaf..509a5d6dde 100644 --- a/src/univ/stattext.cpp +++ b/src/univ/stattext.cpp @@ -88,14 +88,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 fcdda770e1..bfb8106230 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -336,7 +336,7 @@ bool wxWindow::DoDrawBackground(wxDC& dc) rect.height = size.y; wxWindow * const parent = GetParent(); - if ( HasTransparentBackground() && parent ) + if ( HasTransparentBackground() && !UseBgCol() && parent ) { wxASSERT( !IsTopLevel() );