X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/25057abaacf5ccf30bf136ec2ac430eb61664c3b..1eeb64fb65f7e6cf10b05ba8a0875206cf47d94c:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 3f2390950c..db34763fd5 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -296,6 +296,15 @@ bool wxNotebook::Create(wxWindow *parent, if ( !MSWCreateControl(className, wxEmptyString, pos, size) ) return false; + if (HasFlag(wxNB_NOPAGETHEME) || (wxSystemOptions::HasOption(wxT("msw.notebook.themed-background")) && + wxSystemOptions::GetOptionInt(wxT("msw.notebook.themed-background")) == 0)) + { + wxColour col = GetThemeBackgroundColour(); + if (col.Ok()) + { + SetBackgroundColour(col); + } + } return true; } @@ -471,7 +480,7 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const wxSize sizeTotal = sizePage; // We need to make getting tab size part of the wxWidgets API. - wxSize tabSize(0, 0); + wxSize tabSize; if (GetPageCount() > 0) { RECT rect; @@ -618,7 +627,7 @@ bool wxNotebook::InsertPage(size_t nPage, } // and the text - if ( !strText.IsEmpty() ) + if ( !strText.empty() ) { tcItem.mask |= TCIF_TEXT; tcItem.pszText = (wxChar *)strText.c_str(); // const_cast @@ -683,16 +692,6 @@ bool wxNotebook::InsertPage(size_t nPage, InvalidateBestSize(); - if (HasFlag(wxNB_NOPAGETHEME) || (wxSystemOptions::HasOption(wxT("msw.notebook.themed-background")) && - wxSystemOptions::GetOptionInt(wxT("msw.notebook.themed-background")) == 0)) - { - wxColour col = GetThemeBackgroundColour(); - if (col.Ok()) - { - pPage->SetBackgroundColour(col); - } - } - return true; }