Changeset 4186


Ignore:
Timestamp:
Dec 17, 2007, 5:08:44 PM (14 years ago)
Author:
livings124
Message:

show colors in Groups menu items

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/GroupsWindowController.m

    r4183 r4186  
    2626#import "GradientCell.h"
    2727#import "CTGradient.h"
     28#import "NSBezierPathAdditions.h"
    2829#import "NSApplicationAdditions.h"
    2930
     
    262263        [item setTarget: target];
    263264       
    264         /*NSImage * icon;
    265         if (![[dict objectForKey: @"IsFolder"] boolValue])
    266             icon = [[NSWorkspace sharedWorkspace] iconForFileType: [name pathExtension]];
    267         else
    268         {
    269             NSMenu * itemMenu = [[NSMenu alloc] initWithTitle: name];
    270             [itemMenu setAutoenablesItems: NO];
    271             [item setSubmenu: itemMenu];
    272             [itemMenu setDelegate: self];
    273             [itemMenu release];
    274            
    275             icon = [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')];
    276         }
    277        
    278         [icon setScalesWhenResized: YES];
    279         [icon setSize: NSMakeSize(16.0, 16.0)];
    280         [item setImage: icon];*/
     265        NSImage * icon = [[NSImage alloc] initWithSize: NSMakeSize(16.0, 16.0)];
     266        NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(0.0, 0.0, 16.0, 16.0) radius: 4.0];
     267       
     268        [icon lockFocus];
     269        [[self gradientForColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 90];
     270        [icon unlockFocus];
     271       
     272        [item setImage: icon];
     273        [icon release];
    281274       
    282275        [item setRepresentedObject: [dict objectForKey: @"Index"]];
Note: See TracChangeset for help on using the changeset viewer.