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
This commit is contained in:
@@ -620,10 +620,11 @@ void wxToolBar::CreateDisabledImageList()
|
|||||||
wxBitmap bmpDisabled = tool->GetDisabledBitmap();
|
wxBitmap bmpDisabled = tool->GetDisabledBitmap();
|
||||||
if ( bmpDisabled.Ok() )
|
if ( bmpDisabled.Ok() )
|
||||||
{
|
{
|
||||||
|
const wxSize sizeBitmap = bmpDisabled.GetSize();
|
||||||
m_disabledImgList = new wxImageList
|
m_disabledImgList = new wxImageList
|
||||||
(
|
(
|
||||||
m_defaultWidth,
|
sizeBitmap.x,
|
||||||
m_defaultHeight,
|
sizeBitmap.y,
|
||||||
bmpDisabled.GetMask() != NULL,
|
bmpDisabled.GetMask() != NULL,
|
||||||
GetToolsCount()
|
GetToolsCount()
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user