store the folder image in browser cell

This commit is contained in:
Mitchell Livingston 2007-08-10 18:00:44 +00:00
parent 00586a513b
commit 49bffb64f4
2 changed files with 16 additions and 3 deletions

View File

@ -26,6 +26,8 @@
@interface FileBrowserCell : NSBrowserCell
{
NSImage * fFolderImage;
float fPercent;
NSMutableDictionary * fTitleAttributes, * fStatusAttributes;

View File

@ -49,10 +49,21 @@
- (void) setImage: (NSImage *) image
{
if (!image)
image = [[[[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')] copy] autorelease];
{
if (!fFolderImage)
{
fFolderImage = [[[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')] copy];
[fFolderImage setFlipped: YES];
[fFolderImage setScalesWhenResized: YES];
}
image = fFolderImage;
}
else
{
[image setFlipped: YES];
[image setScalesWhenResized: YES];
}
[image setFlipped: YES];
[image setScalesWhenResized: YES];
[super setImage: image];
}