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 "GroupsWindowController.h"
|
||||||
#import "GradientCell.h"
|
#import "GradientCell.h"
|
||||||
#import "CTGradient.h"
|
#import "CTGradient.h"
|
||||||
|
#import "NSBezierPathAdditions.h"
|
||||||
#import "NSApplicationAdditions.h"
|
#import "NSApplicationAdditions.h"
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
@ -261,23 +262,15 @@ GroupsWindowController * fGroupsWindowInstance = nil;
|
||||||
item = [[NSMenuItem alloc] initWithTitle: [dict objectForKey: @"Name"] action: action keyEquivalent: @""];
|
item = [[NSMenuItem alloc] initWithTitle: [dict objectForKey: @"Name"] action: action keyEquivalent: @""];
|
||||||
[item setTarget: target];
|
[item setTarget: target];
|
||||||
|
|
||||||
/*NSImage * icon;
|
NSImage * icon = [[NSImage alloc] initWithSize: NSMakeSize(16.0, 16.0)];
|
||||||
if (![[dict objectForKey: @"IsFolder"] boolValue])
|
NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(0.0, 0.0, 16.0, 16.0) radius: 4.0];
|
||||||
icon = [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]];
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NSMenu * itemMenu = [[NSMenu alloc] initWithTitle: name];
|
|
||||||
[itemMenu setAutoenablesItems: NO];
|
|
||||||
[item setSubmenu: itemMenu];
|
|
||||||
[itemMenu setDelegate: self];
|
|
||||||
[itemMenu release];
|
|
||||||
|
|
||||||
icon = [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')];
|
|
||||||
}
|
|
||||||
|
|
||||||
[icon setScalesWhenResized: YES];
|
[icon lockFocus];
|
||||||
[icon setSize: NSMakeSize(16.0, 16.0)];
|
[[self gradientForColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 90];
|
||||||
[item setImage: icon];*/
|
[icon unlockFocus];
|
||||||
|
|
||||||
|
[item setImage: icon];
|
||||||
|
[icon release];
|
||||||
|
|
||||||
[item setRepresentedObject: [dict objectForKey: @"Index"]];
|
[item setRepresentedObject: [dict objectForKey: @"Index"]];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue