mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
store the folder image in browser cell
This commit is contained in:
parent
00586a513b
commit
49bffb64f4
2 changed files with 16 additions and 3 deletions
|
@ -26,6 +26,8 @@
|
|||
|
||||
@interface FileBrowserCell : NSBrowserCell
|
||||
{
|
||||
NSImage * fFolderImage;
|
||||
|
||||
float fPercent;
|
||||
|
||||
NSMutableDictionary * fTitleAttributes, * fStatusAttributes;
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue