Changeset 4192
- Timestamp:
- Dec 18, 2007, 1:44:37 AM (14 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/GroupsWindowController.h
r4189 r4192 34 34 IBOutlet NSSegmentedControl * fAddRemoveControl; 35 35 36 NSMutableDictionary * fCurrentColorDict , * fGroupGradients;36 NSMutableDictionary * fCurrentColorDict; 37 37 } 38 38 -
trunk/macosx/GroupsWindowController.m
r4190 r4192 375 375 - (CTGradient *) gradientForColor: (NSColor *) color 376 376 { 377 return [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0. 7ofColor: [NSColor whiteColor]]378 endingColor: [color blendedColorWithFraction: 0. 4ofColor: [NSColor whiteColor]]];377 return [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]] 378 endingColor: [color blendedColorWithFraction: 0.7 ofColor: [NSColor whiteColor]]]; 379 379 } 380 380 -
trunk/macosx/TorrentCell.m
r4191 r4192 52 52 #define PADDING_BETWEEN_BAR_AND_STATUS 2.0 53 53 54 #define GROUP_BORDER_X 4.055 #define GROUP_BORDER_Y 1.056 57 54 #define MAX_PIECES 324 58 55 #define BLANK_PIECE -99 … … 200 197 } 201 198 202 - (void) draw InteriorWithFrame: (NSRect) cellFrame inView: (NSView *) controlView203 { 204 [super draw InteriorWithFrame: cellFrame inView: controlView];199 - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView 200 { 201 [super drawWithFrame: cellFrame inView: controlView]; 205 202 206 203 Torrent * torrent = [self representedObject]; 207 204 208 205 BOOL minimal = [fDefaults boolForKey: @"SmallView"]; 206 207 int groupValue = [torrent groupValue]; 208 if (groupValue != -1) 209 { 210 NSRect groupRect = cellFrame; 211 groupRect.size.width = 38.0; 212 groupRect.origin.x -= 1.0; 213 groupRect.size.height += 1.0; 214 groupRect.origin.y -= 1.0; 215 216 [[[GroupsWindowController groupsController] gradientForIndex: groupValue] fillRect: groupRect angle: 270]; 217 } 209 218 210 219 //error image … … 229 238 230 239 //text color 240 NSColor * titleColor, * statusColor; 231 241 BOOL selected = [NSApp isOnLeopardOrBetter] ? [self backgroundStyle] == NSBackgroundStyleDark : [self isHighlighted] 232 242 && [[self highlightColorWithFrame: cellFrame inView: controlView] isEqual: [NSColor alternateSelectedControlColor]]; 233 int groupIndex = [torrent groupValue]; 234 235 NSColor * titleColor = selected && groupIndex == -1 ? [NSColor whiteColor] : [NSColor controlTextColor], 236 * statusColor = selected ? [NSColor whiteColor] : [NSColor darkGrayColor]; 243 if ([NSApp isOnLeopardOrBetter] ? [self backgroundStyle] == NSBackgroundStyleDark : [self isHighlighted] 244 && [[self highlightColorWithFrame: cellFrame inView: controlView] isEqual: [NSColor alternateSelectedControlColor]]) 245 { 246 titleColor = [NSColor whiteColor]; 247 statusColor = [NSColor whiteColor]; 248 } 249 else 250 { 251 titleColor = [NSColor controlTextColor]; 252 statusColor = [NSColor darkGrayColor]; 253 } 237 254 238 255 //minimal status … … 251 268 NSAttributedString * titleString = [self attributedTitleWithColor: titleColor]; 252 269 NSRect titleRect = [self rectForTitleWithString: titleString basedOnMinimalStatusRect: minimalStatusRect inBounds: cellFrame]; 253 254 if (groupIndex != -1)255 [[[GroupsWindowController groupsController] gradientForIndex: [torrent groupValue]] fillBezierPath:256 [NSBezierPath bezierPathWithRoundedRect: NSInsetRect(titleRect, -GROUP_BORDER_X, -GROUP_BORDER_Y) radius: 7.0] angle: 90];257 258 270 [titleString drawInRect: titleRect]; 259 271 … … 561 573 result.size = [string size]; 562 574 result.size.width = MIN(result.size.width, NSMaxX(bounds) - result.origin.x - PADDING_HORIZONAL 563 - ([[self representedObject] groupValue] != -1 ? GROUP_BORDER_X : 0)564 575 - (minimal ? PADDING_BETWEEN_TITLE_AND_MIN_STATUS + statusRect.size.width : 0)); 565 576
Note: See TracChangeset
for help on using the changeset viewer.