Changeset 13600
- Timestamp:
- Oct 29, 2012, 10:17:08 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/FileNameCell.m
r13597 r13600 39 39 #define PADDING_BELOW_STATUS_FILE 2.0 40 40 #define PADDING_BETWEEN_NAME_AND_FOLDER_STATUS 4.0 41 #define PADDING_EXPANSION_FRAME 2.0 41 42 42 43 @interface FileNameCell (Private) … … 143 144 } 144 145 146 - (NSRect) expansionFrameWithFrame: (NSRect) cellFrame inView: (NSView *) view 147 { 148 NSAttributedString * titleString = [self attributedTitle]; 149 NSRect realRect = [self rectForTitleWithString: titleString inBounds: cellFrame]; 150 151 if ([titleString size].width > NSWidth(realRect) 152 && NSMouseInRect([view convertPoint: [[view window] convertScreenToBase: [NSEvent mouseLocation]] fromView: nil], realRect, [view isFlipped])) 153 { 154 realRect.size.width = [titleString size].width; 155 return NSInsetRect(realRect, -PADDING_EXPANSION_FRAME, -PADDING_EXPANSION_FRAME); 156 } 157 158 return NSZeroRect; 159 } 160 161 - (void) drawWithExpansionFrame: (NSRect) cellFrame inView: (NSView *)view 162 { 163 cellFrame.origin.x += PADDING_EXPANSION_FRAME; 164 cellFrame.origin.y += PADDING_EXPANSION_FRAME; 165 166 [fTitleAttributes setObject: [NSColor controlTextColor] forKey: NSForegroundColorAttributeName]; 167 NSAttributedString * titleString = [self attributedTitle]; 168 [titleString drawInRect: cellFrame]; 169 } 170 145 171 @end 146 172
Note: See TracChangeset
for help on using the changeset viewer.