in compact view, when showing the controls on hover don't resize the title if the replaced text was longer than the width of the buttons

This commit is contained in:
Mitchell Livingston 2010-03-20 22:24:54 +00:00
parent ab7e05ec76
commit b6aa2c6e2e
1 changed files with 9 additions and 6 deletions

View File

@ -396,13 +396,16 @@
[fStatusAttributes setObject: statusColor forKey: NSForegroundColorAttributeName];
//minimal status
NSRect minimalStatusRect;
if (minimal && !fHover)
CGFloat minimalTitleRightBound;
if (minimal)
{
NSAttributedString * minimalString = [self attributedStatusString: [self minimalStatusString]];
minimalStatusRect = [self rectForMinimalStatusWithString: minimalString inBounds: cellFrame];
NSRect minimalStatusRect = [self rectForMinimalStatusWithString: minimalString inBounds: cellFrame];
[minimalString drawInRect: minimalStatusRect];
if (!fHover)
[minimalString drawInRect: minimalStatusRect];
minimalTitleRightBound = NSMinX(minimalStatusRect);
}
//progress
@ -440,7 +443,7 @@
const NSRect controlRect = [self controlButtonRectForBounds: cellFrame];
[self drawImage: controlImage inRect: controlRect];
minimalStatusRect = controlRect; //used for limiting title width
minimalTitleRightBound = MIN(minimalTitleRightBound, NSMinX(controlRect));
//reveal button
NSString * revealImageString;
@ -472,7 +475,7 @@
//title
NSAttributedString * titleString = [self attributedTitle];
NSRect titleRect = [self rectForTitleWithString: titleString withRightBound: NSMinX(minimalStatusRect) inBounds: cellFrame];
NSRect titleRect = [self rectForTitleWithString: titleString withRightBound: minimalTitleRightBound inBounds: cellFrame];
[titleString drawInRect: titleRect];
//priority icon