Frameworks/Adium Framework/Source/AIListCell.m
branchadium-1.5.11
changeset 6016 325e2ab3406f
parent 4161 8de0a4e32e42
equal deleted inserted replaced
6014:fcb71cb71a3d 6016:325e2ab3406f
   104 	}
   104 	}
   105 
   105 
   106 	isGroup = [[proxyObject listObject] isKindOfClass:[AIListGroup class]];
   106 	isGroup = [[proxyObject listObject] isKindOfClass:[AIListGroup class]];
   107 }
   107 }
   108 
   108 
   109 @synthesize isGroup, controlView;
   109 @synthesize isGroup, outlineControlView;
   110 
   110 
   111 //Return that this cell is draggable
   111 //Return that this cell is draggable
   112 - (NSUInteger)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView
   112 - (NSCellHitResult)hitTestForEvent:(NSEvent *)event inRect:(NSRect)cellFrame ofView:(NSView *)controlView
   113 {
   113 {
   114 	return NSCellHitContentArea;
   114 	return NSCellHitContentArea;
   115 }
   115 }
   116 
   116 
   117 //Display options ------------------------------------------------------------------------------------------------------
   117 //Display options ------------------------------------------------------------------------------------------------------
   368 
   368 
   369 //YES if our cell is currently selected
   369 //YES if our cell is currently selected
   370 - (BOOL)cellIsSelected
   370 - (BOOL)cellIsSelected
   371 {
   371 {
   372 	return ([self isHighlighted] &&
   372 	return ([self isHighlighted] &&
   373 		   [[controlView window] isKeyWindow] &&
   373 		   [[self.outlineControlView window] isKeyWindow] &&
   374 		   [[controlView window] firstResponder] == controlView);
   374 		   [[self.outlineControlView window] firstResponder] == self.outlineControlView);
   375 }
   375 }
   376 
   376 
   377 //YES if a grid would be visible behind this cell (needs to be drawn)
   377 //YES if a grid would be visible behind this cell (needs to be drawn)
   378 - (BOOL)drawGridBehindCell
   378 - (BOOL)drawGridBehindCell
   379 {
   379 {
   382 
   382 
   383 //The background color for this cell.  This will either be [controlView backgroundColor] or [controlView alternatingGridColor]
   383 //The background color for this cell.  This will either be [controlView backgroundColor] or [controlView alternatingGridColor]
   384 - (NSColor *)backgroundColor
   384 - (NSColor *)backgroundColor
   385 {
   385 {
   386 	//We could just call backgroundColorForRow: but it's best to avoid doing a rowForItem lookup if there is no grid
   386 	//We could just call backgroundColorForRow: but it's best to avoid doing a rowForItem lookup if there is no grid
   387 	if ([controlView usesAlternatingRowBackgroundColors]) {
   387 	if ([self.outlineControlView usesAlternatingRowBackgroundColors]) {
   388 		return [controlView backgroundColorForRow:[controlView rowForItem:proxyObject]];
   388 		return [self.outlineControlView backgroundColorForRow:[self.outlineControlView rowForItem:proxyObject]];
   389 	} else {
   389 	} else {
   390 		return [controlView backgroundColor];
   390 		return [self.outlineControlView backgroundColor];
   391 	}
   391 	}
   392 }
   392 }
   393 
   393 
   394 #pragma mark Accessibility
   394 #pragma mark Accessibility
   395 
   395 
   432 
   432 
   433 	} else if ([attribute isEqualToString:NSAccessibilityTitleAttribute]) {
   433 	} else if ([attribute isEqualToString:NSAccessibilityTitleAttribute]) {
   434 		value = [self labelString];
   434 		value = [self labelString];
   435 		
   435 		
   436 	} else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) {
   436 	} else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) {
   437 		value = [controlView window];
   437 		value = [self.outlineControlView window];
   438                 
   438                 
   439 	} else {
   439 	} else {
   440 		value = [super accessibilityAttributeValue:attribute];
   440 		value = [super accessibilityAttributeValue:attribute];
   441 	}
   441 	}
   442 
   442