Changeset 10409


Ignore:
Timestamp:
Mar 20, 2010, 10:24:54 PM (12 years ago)
Author:
livings124
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r10408 r10409  
    397397   
    398398    //minimal status
    399     NSRect minimalStatusRect;
    400     if (minimal && !fHover)
     399    CGFloat minimalTitleRightBound;
     400    if (minimal)
    401401    {
    402402        NSAttributedString * minimalString = [self attributedStatusString: [self minimalStatusString]];
    403         minimalStatusRect = [self rectForMinimalStatusWithString: minimalString inBounds: cellFrame];
    404        
    405         [minimalString drawInRect: minimalStatusRect];
     403        NSRect minimalStatusRect = [self rectForMinimalStatusWithString: minimalString inBounds: cellFrame];
     404       
     405        if (!fHover)
     406            [minimalString drawInRect: minimalStatusRect];
     407       
     408        minimalTitleRightBound = NSMinX(minimalStatusRect);
    406409    }
    407410   
     
    441444        const NSRect controlRect = [self controlButtonRectForBounds: cellFrame];
    442445        [self drawImage: controlImage inRect: controlRect];
    443         minimalStatusRect = controlRect; //used for limiting title width
     446        minimalTitleRightBound = MIN(minimalTitleRightBound, NSMinX(controlRect));
    444447       
    445448        //reveal button
     
    473476    //title
    474477    NSAttributedString * titleString = [self attributedTitle];
    475     NSRect titleRect = [self rectForTitleWithString: titleString withRightBound: NSMinX(minimalStatusRect) inBounds: cellFrame];
     478    NSRect titleRect = [self rectForTitleWithString: titleString withRightBound: minimalTitleRightBound inBounds: cellFrame];
    476479    [titleString drawInRect: titleRect];
    477480   
Note: See TracChangeset for help on using the changeset viewer.