corrected bg colour inheritance once again: only immediate transparent children should inherit non inheritable parent bg colour
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1533,13 +1533,7 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
height = 0;
|
height = 0;
|
||||||
|
|
||||||
// if our parent had prepared a defer window handle for us, use it
|
// if our parent had prepared a defer window handle for us, use it
|
||||||
wxWindowMSW *parent =
|
wxWindowMSW *parent = GetParent();
|
||||||
#ifdef __WXUNIVERSAL__
|
|
||||||
wxDynamicCast(m_parent, wxWindowMSW)
|
|
||||||
#else
|
|
||||||
m_parent
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
HDWP hdwp = parent ? (HDWP)parent->m_hDWP : NULL;
|
HDWP hdwp = parent ? (HDWP)parent->m_hDWP : NULL;
|
||||||
if ( hdwp )
|
if ( hdwp )
|
||||||
{
|
{
|
||||||
@@ -2304,8 +2298,6 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
|
|||||||
{
|
{
|
||||||
wxLogLastError(_T("EndDeferWindowPos"));
|
wxLogLastError(_T("EndDeferWindowPos"));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_hDWP = NULL;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif // __SMARTPHONE__
|
#endif // __SMARTPHONE__
|
||||||
@@ -4141,9 +4133,16 @@ wxColour wxWindowMSW::MSWGetBgColourForChild(wxWindow *child)
|
|||||||
{
|
{
|
||||||
if ( m_hasBgCol )
|
if ( m_hasBgCol )
|
||||||
{
|
{
|
||||||
|
// our background colour applies to:
|
||||||
|
// 1. this window itself, always
|
||||||
|
// 2. all children unless the colour is "not inheritable"
|
||||||
|
// 3. immediate transparent children which should show the same
|
||||||
|
// background as we do, but not for transparent grandchildren
|
||||||
|
// which use the background of their immediate parent instead
|
||||||
if ( m_inheritBgCol ||
|
if ( m_inheritBgCol ||
|
||||||
child == this ||
|
child == this ||
|
||||||
child->HasTransparentBackground() )
|
(child->HasTransparentBackground() &&
|
||||||
|
child->GetParent() == this) )
|
||||||
{
|
{
|
||||||
return GetBackgroundColour();
|
return GetBackgroundColour();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user