Changeset 4201
- Timestamp:
- Dec 18, 2007, 5:05:49 PM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/GroupsWindowController.h
r4194 r4201 39 39 + (GroupsWindowController *) groupsController; 40 40 41 - ( NSColor *) colorForIndex: (int) index;41 - (CTGradient *) gradientForIndex: (int) index; 42 42 43 43 - (int) orderValueForIndex: (int) index; -
trunk/macosx/GroupsWindowController.m
r4200 r4201 41 41 - (void) saveGroups; 42 42 43 - (CTGradient *) gradientFor PreviewColor: (NSColor *) color;43 - (CTGradient *) gradientForColor: (NSColor *) color; 44 44 - (void) changeColor: (id) sender; 45 45 … … 134 134 } 135 135 136 - ( NSColor *) colorForIndex: (int) index136 - (CTGradient *) gradientForIndex: (int) index 137 137 { 138 138 if (index < 0) … … 143 143 while ((dict = [enumerator nextObject])) 144 144 if ([[dict objectForKey: @"Index"] intValue] == index) 145 return [ dict objectForKey: @"Color"];145 return [self gradientForColor: [dict objectForKey: @"Color"]]; 146 146 147 147 return nil; … … 169 169 NSString * identifier = [tableColumn identifier]; 170 170 if ([identifier isEqualToString: @"Color"]) 171 return [self gradientFor PreviewColor: [[fGroups objectAtIndex: row] objectForKey: @"Color"]];171 return [self gradientForColor: [[fGroups objectAtIndex: row] objectForKey: @"Color"]]; 172 172 else 173 173 return [[fGroups objectAtIndex: row] objectForKey: @"Name"]; … … 352 352 353 353 [icon lockFocus]; 354 [[self gradientFor PreviewColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 270.0];354 [[self gradientForColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 270.0]; 355 355 [icon unlockFocus]; 356 356 … … 376 376 } 377 377 378 - (CTGradient *) gradientFor PreviewColor: (NSColor *) color378 - (CTGradient *) gradientForColor: (NSColor *) color 379 379 { 380 380 return [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0.7 ofColor: [NSColor whiteColor]] -
trunk/macosx/TorrentCell.m
r4197 r4201 208 208 BOOL minimal = [fDefaults boolForKey: @"SmallView"]; 209 209 210 //group coloring 211 NSRect iconRect = [self iconRectForBounds: cellFrame]; 212 210 213 int groupValue = [torrent groupValue]; 211 214 if (groupValue != -1) 212 { 213 NSRect groupRect = cellFrame; 214 groupRect.size.width = minimal ? WIDTH_GROUP_MIN : WIDTH_GROUP; 215 groupRect.origin.x -= 1.0; 216 groupRect.size.height += 1.0; 217 groupRect.origin.y -= 1.0; 218 219 NSColor * color = [[[GroupsWindowController groupsController] colorForIndex: groupValue] 220 blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]]; 221 CTGradient * gradient = [CTGradient gradientWithBeginningColor: color endingColor: [color colorWithAlphaComponent: 0.0]]; 222 [gradient fillRect: groupRect angle: 0.0]; 223 } 215 [[[GroupsWindowController groupsController] gradientForIndex: groupValue] fillBezierPath: 216 [NSBezierPath bezierPathWithRoundedRect: NSInsetRect(iconRect, -2.0, -2.0) radius: 6.0] angle: 90.0]; 224 217 225 218 //error image … … 233 226 //icon 234 227 NSImage * icon = minimal && error ? fErrorImage : [torrent icon]; 235 NSRect iconRect = [self iconRectForBounds: cellFrame];236 228 [icon drawInRect: iconRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0]; 237 229
Note: See TracChangeset
for help on using the changeset viewer.