From: Vadim Zeitlin Date: Sun, 27 Feb 2011 12:45:19 +0000 (+0000) Subject: Specify correct size for disabled image list in wxMSW wxToolBar. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f87ddf1834c677a33f0c8d243d580d6d105447ef Specify correct size for disabled image list in wxMSW wxToolBar. Use the real bitmap size instead of the default tool size when creating the disabled image list as the actual bitmap size could be less than the default one and in this case adding images to the image list later would fail (as could be seen by using custom bitmaps in the toolbar sample). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 44f08bffb8..5ab71b53b5 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -620,10 +620,11 @@ void wxToolBar::CreateDisabledImageList() wxBitmap bmpDisabled = tool->GetDisabledBitmap(); if ( bmpDisabled.Ok() ) { + const wxSize sizeBitmap = bmpDisabled.GetSize(); m_disabledImgList = new wxImageList ( - m_defaultWidth, - m_defaultHeight, + sizeBitmap.x, + sizeBitmap.y, bmpDisabled.GetMask() != NULL, GetToolsCount() );