Fix an issue where _CPImageAndTextView, if it had an image, wouldn't show the image if it hadn't already been loaded. In other words, it now listens for image load events and redisplays.

This commit is contained in:
Ross Boucher
2010-01-08 09:34:43 -08:00
parent b675adbbb0
commit f61a6ba5ff
+17 -2
View File
@@ -285,13 +285,28 @@ var HORIZONTAL_MARGIN = 3.0,
{
if (_image == anImage)
return;
if ([_image delegate] === self)
[_image setDelegate:nil];
_image = anImage;
_flags |= _CPImageAndTextViewImageChangedFlag;
if ([_image loadStatus] !== CPImageLoadStatusCompleted)
[_image setDelegate:self];
[self setNeedsLayout];
}
- (void)imageDidLoad:(id)anImage
{
if (anImage === _image)
{
_flags |= _CPImageAndTextViewImageChangedFlag;
[self setNeedsLayout];
}
}
- (CPImage)image
{
return _image;