Changeset 4191


Ignore:
Timestamp:
Dec 17, 2007, 10:30:28 PM (14 years ago)
Author:
livings124
Message:

fix sizing of group labels with long file names

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r4189 r4191  
    20492049- (void) menuNeedsUpdate: (NSMenu *) menu
    20502050{
    2051     #warning if not group menu, return
    2052     int i, keep = (menu == fGroupsSetMenu || menu == fGroupsSetContextMenu ) ? 2 : 0;
    2053     for (i = [menu numberOfItems]-1 - keep; i >= 0; i--)
    2054         [menu removeItemAtIndex: i];
    2055    
    2056     NSMenu * groupMenu = [[GroupsWindowController groupsController] groupMenuWithTarget: self action: @selector(setGroup:)];
    2057     [menu appendItemsFromMenu: groupMenu atIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [groupMenu numberOfItems])]
    2058             atBottom: NO];
     2051    if (menu == fGroupsSetMenu || menu == fGroupsSetContextMenu)
     2052    {
     2053        int i, keep = (menu == fGroupsSetMenu || menu == fGroupsSetContextMenu) ? 2 : 0;
     2054        for (i = [menu numberOfItems]-1 - keep; i >= 0; i--)
     2055            [menu removeItemAtIndex: i];
     2056       
     2057        NSMenu * groupMenu = [[GroupsWindowController groupsController] groupMenuWithTarget: self action: @selector(setGroup:)];
     2058        [menu appendItemsFromMenu: groupMenu atIndexes: [NSIndexSet indexSetWithIndexesInRange:
     2059                NSMakeRange(0, [groupMenu numberOfItems])] atBottom: NO];
     2060    }
    20592061}
    20602062
  • trunk/macosx/TorrentCell.m

    r4183 r4191  
    5252#define PADDING_BETWEEN_BAR_AND_STATUS 2.0
    5353
    54 #define GROUP_BORDER_X -4.0
    55 #define GROUP_BORDER_Y -1.0
     54#define GROUP_BORDER_X 4.0
     55#define GROUP_BORDER_Y 1.0
    5656
    5757#define MAX_PIECES 324
     
    254254    if (groupIndex != -1)
    255255        [[[GroupsWindowController groupsController] gradientForIndex: [torrent groupValue]] fillBezierPath:
    256             [NSBezierPath bezierPathWithRoundedRect: NSInsetRect(titleRect, GROUP_BORDER_X, GROUP_BORDER_Y) radius: 7.0] angle: 90];
     256            [NSBezierPath bezierPathWithRoundedRect: NSInsetRect(titleRect, -GROUP_BORDER_X, -GROUP_BORDER_Y) radius: 7.0] angle: 90];
    257257   
    258258    [titleString drawInRect: titleRect];
     
    561561    result.size = [string size];
    562562    result.size.width = MIN(result.size.width, NSMaxX(bounds) - result.origin.x - PADDING_HORIZONAL
     563                            - ([[self representedObject] groupValue] != -1 ? GROUP_BORDER_X : 0)
    563564                            - (minimal ? PADDING_BETWEEN_TITLE_AND_MIN_STATUS + statusRect.size.width : 0));
    564565   
Note: See TracChangeset for help on using the changeset viewer.