mirror of
https://github.com/transmission/transmission
synced 2025-03-10 14:13:23 +00:00
show colors in Groups menu items
This commit is contained in:
parent
f9491abf18
commit
c103c57168
1 changed files with 9 additions and 16 deletions
|
@ -25,6 +25,7 @@
|
|||
#import "GroupsWindowController.h"
|
||||
#import "GradientCell.h"
|
||||
#import "CTGradient.h"
|
||||
#import "NSBezierPathAdditions.h"
|
||||
#import "NSApplicationAdditions.h"
|
||||
|
||||
typedef enum
|
||||
|
@ -261,23 +262,15 @@ GroupsWindowController * fGroupsWindowInstance = nil;
|
|||
item = [[NSMenuItem alloc] initWithTitle: [dict objectForKey: @"Name"] action: action keyEquivalent: @""];
|
||||
[item setTarget: target];
|
||||
|
||||
/*NSImage * icon;
|
||||
if (![[dict objectForKey: @"IsFolder"] boolValue])
|
||||
icon = [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]];
|
||||
else
|
||||
{
|
||||
NSMenu * itemMenu = [[NSMenu alloc] initWithTitle: name];
|
||||
[itemMenu setAutoenablesItems: NO];
|
||||
[item setSubmenu: itemMenu];
|
||||
[itemMenu setDelegate: self];
|
||||
[itemMenu release];
|
||||
NSImage * icon = [[NSImage alloc] initWithSize: NSMakeSize(16.0, 16.0)];
|
||||
NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(0.0, 0.0, 16.0, 16.0) radius: 4.0];
|
||||
|
||||
icon = [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')];
|
||||
}
|
||||
[icon lockFocus];
|
||||
[[self gradientForColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 90];
|
||||
[icon unlockFocus];
|
||||
|
||||
[icon setScalesWhenResized: YES];
|
||||
[icon setSize: NSMakeSize(16.0, 16.0)];
|
||||
[item setImage: icon];*/
|
||||
[item setImage: icon];
|
||||
[icon release];
|
||||
|
||||
[item setRepresentedObject: [dict objectForKey: @"Index"]];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue