From 296a086a76aceb7f50c317d8d577bd4121db6414 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 29 Aug 2007 15:39:12 +0000 Subject: [PATCH] The toolbar background for some colour schemes cannot be determined (for example Silver). So set an explicit background colour to avoid parts of the background being painted wrongly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/tbar95.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 73e9652324..ec04b3525d 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -265,6 +265,15 @@ bool wxToolBar::MSWCreateToolbar(const wxPoint& pos, const wxSize& size) // toolbar-specific post initialisation ::SendMessage(GetHwnd(), TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); + // The toolbar background for some colour schemes cannot be determined + // (for example Silver). So set an explicit background colour to avoid parts of + // the background being painted wrongly. + + int majorVersion, minorVersion; + wxGetOsVersion(& majorVersion, & minorVersion); + if (majorVersion < 6) + SetBackgroundColour(GetBackgroundColour()); + return true; } @@ -371,7 +380,7 @@ wxSize wxToolBar::DoGetBestSize() const if (!(GetWindowStyle() & wxTB_NODIVIDER)) sizeBest.y += 2; sizeBest.y ++; - } + } CacheBestSize(sizeBest);