Changeset 5834
- Timestamp:
- May 14, 2008, 9:35:37 PM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/GroupsController.m
r5589 r5834 34 34 - (void) saveGroups; 35 35 36 - (CTGradient *) gradientForColor: (NSColor *) color;37 36 - (NSImage *) imageForGroup: (NSDictionary *) dict isSmall: (BOOL) small; 38 37 … … 133 132 { 134 133 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]]; 136 136 } 137 137 … … 289 289 } 290 290 291 - (CTGradient *) gradientForColor: (NSColor *) color292 {293 return [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0.65 ofColor: [NSColor whiteColor]]294 endingColor: [color blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]];295 }296 297 291 - (NSImage *) imageForGroup: (NSDictionary *) dict isSmall: (BOOL) small 298 292 { 299 293 float width = small ? ICON_WIDTH_SMALL : ICON_WIDTH; 300 294 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]; 302 297 NSImage * icon = [[NSImage alloc] initWithSize: rect.size]; 303 298 299 NSColor * color = [dict objectForKey: @"Color"]; 300 304 301 [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 306 314 [icon unlockFocus]; 307 315 -
trunk/macosx/TorrentCell.m
r5805 r5834 432 432 } 433 433 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]; 436 447 } 437 448
Note: See TracChangeset
for help on using the changeset viewer.