Make the greyed image list be the same size as the main image list,
don't assume 16x16 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3958,21 +3958,22 @@ class CustomTreeCtrl(wx.PyScrolledWindow):
|
|||||||
self._imageListNormal = imageList
|
self._imageListNormal = imageList
|
||||||
self._ownsImageListNormal = False
|
self._ownsImageListNormal = False
|
||||||
self._dirty = True
|
self._dirty = True
|
||||||
|
|
||||||
# Don't do any drawing if we're setting the list to NULL,
|
# Don't do any drawing if we're setting the list to NULL,
|
||||||
# since we may be in the process of deleting the tree control.
|
# since we may be in the process of deleting the tree control.
|
||||||
if imageList:
|
if imageList:
|
||||||
self.CalculateLineHeight()
|
self.CalculateLineHeight()
|
||||||
|
|
||||||
# We gray out the image list to use the grayed icons with disabled items
|
# We gray out the image list to use the grayed icons with disabled items
|
||||||
self._grayedImageList = wx.ImageList(16, 16, True, 0)
|
sz = imageList.GetSize(0)
|
||||||
|
self._grayedImageList = wx.ImageList(sz[0], sz[1], True, 0)
|
||||||
for ii in xrange(imageList.GetImageCount()):
|
|
||||||
|
for ii in xrange(imageList.GetImageCount()):
|
||||||
bmp = imageList.GetBitmap(ii)
|
bmp = imageList.GetBitmap(ii)
|
||||||
image = wx.ImageFromBitmap(bmp)
|
image = wx.ImageFromBitmap(bmp)
|
||||||
image = GrayOut(image)
|
image = GrayOut(image)
|
||||||
newbmp = wx.BitmapFromImage(image)
|
newbmp = wx.BitmapFromImage(image)
|
||||||
self._grayedImageList.Add(newbmp)
|
self._grayedImageList.Add(newbmp)
|
||||||
|
|
||||||
|
|
||||||
def SetStateImageList(self, imageList):
|
def SetStateImageList(self, imageList):
|
||||||
|
Reference in New Issue
Block a user