Changeset 5014
- Timestamp:
- 10/26/07 14:00:31 (9 months ago)
- Files:
-
- WiredClient/trunk/WCTransferCell.m (modified) (3 diffs)
- WiredClient/trunk/WCUserCell.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/WCTransferCell.m
r4799 r5014 111 111 112 112 - (void)drawWithFrame:(NSRect)frame inView:(NSView *)view { 113 NSProgressIndicator *progressIndicator;114 NS AttributedString *string;115 NSString *name, *status;116 NSImage *icon;117 NSRect rect;118 NSSize size;119 CGFloat offset;113 NSProgressIndicator *progressIndicator; 114 NSMutableAttributedString *string; 115 NSString *name, *status; 116 NSImage *icon; 117 NSRect rect; 118 NSSize size; 119 CGFloat offset; 120 120 121 121 name = [(NSDictionary *) [self objectValue] objectForKey:WCTransferCellNameKey]; … … 125 125 126 126 rect = NSMakeRect(frame.origin.x - 2.0, frame.origin.y, frame.size.width, 16.0); 127 string = [NSAttributedString attributedStringWithString:name attributes:_nameAttributes]; 127 string = [NSMutableAttributedString attributedStringWithString:name attributes:_nameAttributes]; 128 129 if([self isHighlighted] && [_nameCell highlightColorWithFrame:rect inView:view] == [NSColor alternateSelectedControlColor]) { 130 [string addAttribute:NSForegroundColorAttributeName 131 value:[NSColor whiteColor] 132 range:NSMakeRange(0, [string length])]; 133 } 134 128 135 [_nameCell setAttributedStringValue:string]; 129 [_nameCell setHighlighted:[self isHighlighted]];130 136 [_nameCell drawWithFrame:rect inView:view]; 131 137 … … 151 157 offset = [self drawsProgressIndicator] ? 32.0 : 19.0; 152 158 rect = NSMakeRect(frame.origin.x - 2.0, frame.origin.y + offset, frame.size.width, 14.0); 153 string = [NSAttributedString attributedStringWithString:status attributes:_statusAttributes]; 159 string = [NSMutableAttributedString attributedStringWithString:status attributes:_statusAttributes]; 160 161 if([self isHighlighted] && [_statusCell highlightColorWithFrame:rect inView:view] == [NSColor alternateSelectedControlColor]) { 162 [string addAttribute:NSForegroundColorAttributeName 163 value:[NSColor whiteColor] 164 range:NSMakeRange(0, [string length])]; 165 } 166 154 167 [_statusCell setAttributedStringValue:string]; 155 [_statusCell setHighlighted:[self isHighlighted]];156 168 [_statusCell drawWithFrame:rect inView:view]; 157 169 } WiredClient/trunk/WCUserCell.m
r4439 r5014 36 36 self = [super init]; 37 37 38 _nickCell = [[NS Cell alloc] init];38 _nickCell = [[NSTextFieldCell alloc] init]; 39 39 _statusCell = [[NSCell alloc] init]; 40 40 … … 131 131 132 132 - (void)drawWithFrame:(NSRect)frame inView:(NSView *)view { 133 NS AttributedString *string;134 NSString *nick, *status;135 NSRect rect;133 NSMutableAttributedString *string; 134 NSString *nick, *status; 135 NSRect rect; 136 136 137 137 nick = [(NSDictionary *) [self objectValue] objectForKey:WCUserCellNickKey]; … … 147 147 } 148 148 149 string = [NSAttributedString attributedStringWithString:nick attributes:_nickAttributes]; 150 149 string = [NSMutableAttributedString attributedStringWithString:nick attributes:_nickAttributes]; 150 151 if([self isHighlighted] && [_nickCell highlightColorWithFrame:rect inView:view] == [NSColor alternateSelectedControlColor]) { 152 [string addAttribute:NSForegroundColorAttributeName 153 value:[NSColor whiteColor] 154 range:NSMakeRange(0, [string length])]; 155 } 156 151 157 [_nickCell setAttributedStringValue:[string attributedStringByApplyingFilter:_filter]]; 152 [_nickCell setHighlighted:[self isHighlighted]];153 158 [_nickCell drawWithFrame:rect inView:view]; 154 159 … … 158 163 159 164 [_statusCell setAttributedStringValue:[string attributedStringByApplyingFilter:_filter]]; 160 [_statusCell setHighlighted:[self isHighlighted]];161 165 [_statusCell drawWithFrame:rect inView:view]; 162 166 }
