Inherit notebook background recursively under wxMSW.
With MSWSetTransparentBackground() hack only the panel which was the immediate child of wxNotebook (i.e. its page) inherited the notebook background but not its children. This resulted in jarring background discontinuities when nested panels were used. Fix this by inheriting notebook background in all child panels by testing for the return value of the parents MSWHasInheritableBackground() method in wxPanel::HasTransparentBackground() recursively. Closes #12317. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -104,10 +104,6 @@ WX_DELEGATE_TO_CONTROL_CONTAINER(wxPanel, wxWindow)
|
||||
void wxPanel::Init()
|
||||
{
|
||||
WX_INIT_CONTROL_CONTAINER();
|
||||
|
||||
#ifdef __WXMSW__
|
||||
m_isTransparent = false;
|
||||
#endif // __WXMSW__
|
||||
}
|
||||
|
||||
bool wxPanel::Create(wxWindow *parent, wxWindowID id,
|
||||
@@ -141,3 +137,20 @@ void wxPanel::InitDialog()
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
#ifdef __WXMSW__
|
||||
|
||||
bool wxPanel::HasTransparentBackground()
|
||||
{
|
||||
for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
|
||||
{
|
||||
if ( win->MSWHasInheritableBackground() )
|
||||
return true;
|
||||
|
||||
if ( win->IsTopLevel() )
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // __WXMSW__
|
||||
|
||||
Reference in New Issue
Block a user