]> git.saurik.com Git - wxWidgets.git/commitdiff
Specify correct size for disabled image list in wxMSW wxToolBar.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:45:19 +0000 (12:45 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:45:19 +0000 (12:45 +0000)
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

src/msw/toolbar.cpp

index 44f08bffb811235d869af5df9eea84860fba4238..5ab71b53b5c8b18450f3f4194d7a577a94caac1d 100644 (file)
@@ -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()
                                         );