Changeset 5834


Ignore:
Timestamp:
May 14, 2008, 9:35:37 PM (14 years ago)
Author:
livings124
Message:

adjust the look of the group colors

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/GroupsController.m

    r5589 r5834  
    3434- (void) saveGroups;
    3535
    36 - (CTGradient *) gradientForColor: (NSColor *) color;
    3736- (NSImage *) imageForGroup: (NSDictionary *) dict isSmall: (BOOL) small;
    3837
     
    133132{
    134133    int orderIndex = [self rowValueForIndex: index];
    135     return orderIndex != -1 ? [self gradientForColor: [[fGroups objectAtIndex: orderIndex] objectForKey: @"Color"]] : nil;
     134    //return orderIndex != -1 ? [self gradientForColor: [[fGroups objectAtIndex: orderIndex] objectForKey: @"Color"]] : nil;
     135    return [CTGradient gradientWithBeginningColor: [NSColor blueColor] endingColor: [NSColor redColor]];
    136136}
    137137
     
    289289}
    290290
    291 - (CTGradient *) gradientForColor: (NSColor *) color
    292 {
    293     return [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0.65 ofColor: [NSColor whiteColor]]
    294             endingColor: [color blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]];
    295 }
    296 
    297291- (NSImage *) imageForGroup: (NSDictionary *) dict isSmall: (BOOL) small
    298292{
    299293    float width = small ? ICON_WIDTH_SMALL : ICON_WIDTH;
    300294    NSRect rect = NSMakeRect(0.0, 0.0, width, width);
    301     NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: rect radius: 4.0];
     295   
     296    NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: rect radius: 3.0];
    302297    NSImage * icon = [[NSImage alloc] initWithSize: rect.size];
    303298   
     299    NSColor * color = [dict objectForKey: @"Color"];
     300   
    304301    [icon lockFocus];
    305     [[self gradientForColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 270.0];
     302   
     303    //border
     304    CTGradient * gradient = [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0.55 ofColor:
     305                                [NSColor whiteColor]] endingColor: color];
     306    [gradient fillBezierPath: bp angle: 270.0];
     307   
     308    //inside
     309    bp = [NSBezierPath bezierPathWithRoundedRect: NSInsetRect(rect, 1.0, 1.0) radius: 3.0];
     310    gradient = [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0.75 ofColor: [NSColor whiteColor]]
     311                endingColor: [color blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]];
     312    [gradient fillBezierPath: bp angle: 270.0];
     313   
    306314    [icon unlockFocus];
    307315   
  • trunk/macosx/TorrentCell.m

    r5805 r5834  
    432432        }
    433433       
    434         [[[GroupsController groups] gradientForIndex: groupValue] fillBezierPath:
    435             [NSBezierPath bezierPathWithRoundedRect: groupRect radius: 6.0] angle: 90.0];
     434        NSColor * groupColor = [[GroupsController groups] colorForIndex: groupValue];
     435       
     436        //border
     437        NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: groupRect radius: 6.0];
     438        CTGradient * gradient = [CTGradient gradientWithBeginningColor: [groupColor blendedColorWithFraction: 0.55 ofColor:
     439                                [NSColor whiteColor]] endingColor: groupColor];
     440        [gradient fillBezierPath: bp angle: 90.0];
     441       
     442        //inside
     443        bp = [NSBezierPath bezierPathWithRoundedRect: NSInsetRect(groupRect, 1.0, 1.0) radius: 6.0];
     444        gradient = [CTGradient gradientWithBeginningColor: [groupColor blendedColorWithFraction: 0.65 ofColor: [NSColor whiteColor]]
     445                    endingColor: [groupColor blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]];
     446        [gradient fillBezierPath: bp angle: 90.0];
    436447    }
    437448   
Note: See TracChangeset for help on using the changeset viewer.