Added CanApplyParentThemeBackground and use it in wxMSW's
wxNotebook::ApplyThemeBackground. It's in the common base classes so that someday it's usage can expand to the other platforms as well. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -966,24 +966,15 @@ void wxNotebook::ApplyThemeBackground(wxWindow*, const wxColour&)
|
||||
#endif
|
||||
{
|
||||
#if wxUSE_UXTHEME
|
||||
// Don't set the background for buttons since this will
|
||||
// switch it into ownerdraw mode
|
||||
// Special case for wxButton: Don't set the background for buttons since
|
||||
// this will switch it into ownerdraw mode
|
||||
if (window->IsKindOf(CLASSINFO(wxButton)) && !window->IsKindOf(CLASSINFO(wxBitmapButton)))
|
||||
// This is essential, otherwise you'll see dark grey
|
||||
// corners in the buttons.
|
||||
((wxButton*)window)->wxControl::SetBackgroundColour(colour);
|
||||
else if (window->IsKindOf(CLASSINFO(wxStaticText)) ||
|
||||
window->IsKindOf(CLASSINFO(wxStaticBox)) ||
|
||||
window->IsKindOf(CLASSINFO(wxStaticLine)) ||
|
||||
window->IsKindOf(CLASSINFO(wxRadioButton)) ||
|
||||
window->IsKindOf(CLASSINFO(wxRadioBox)) ||
|
||||
window->IsKindOf(CLASSINFO(wxCheckBox)) ||
|
||||
window->IsKindOf(CLASSINFO(wxBitmapButton)) ||
|
||||
window->IsKindOf(CLASSINFO(wxSlider)) ||
|
||||
window->IsKindOf(CLASSINFO(wxPanel)) ||
|
||||
(window->IsKindOf(CLASSINFO(wxNotebook)) && (window != this)) ||
|
||||
window->IsKindOf(CLASSINFO(wxScrolledWindow))
|
||||
)
|
||||
|
||||
// for all other classes let them decide
|
||||
else if ((window != this) && window->CanApplyParentThemeBackground())
|
||||
{
|
||||
window->SetBackgroundColour(colour);
|
||||
}
|
||||
|
Reference in New Issue
Block a user