From b6aa2c6e2e5b84f60efe2db65584dc6f366d1dbf Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 20 Mar 2010 22:24:54 +0000 Subject: [PATCH] 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 --- macosx/TorrentCell.m | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index f6b82c924..e7952008e 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -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]; + + if (!fHover) + [minimalString drawInRect: minimalStatusRect]; - [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 -- 2.40.0