Changeset 10406


Ignore:
Timestamp:
Mar 20, 2010, 6:27:09 PM (12 years ago)
Author:
livings124
Message:

don't set up a tracking area over the entire cell when not in compact view

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r10405 r10406  
    229229            mouseLocation: (NSPoint) mouseLocation
    230230{
    231     NSTrackingAreaOptions options = NSTrackingEnabledDuringMouseDrag | NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways;
     231    const NSTrackingAreaOptions options = NSTrackingEnabledDuringMouseDrag | NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways;
    232232   
    233233    //whole row
    234     NSTrackingAreaOptions rowOptions = options;
    235     if (NSMouseInRect(mouseLocation, cellFrame, [controlView isFlipped]))
    236     {
    237         rowOptions |= NSTrackingAssumeInside;
    238         [(TorrentTableView *)controlView setRowHover: [[userInfo objectForKey: @"Row"] integerValue]];
    239     }
    240    
    241     NSMutableDictionary * rowInfo = [userInfo mutableCopy];
    242     [rowInfo setObject: @"Row" forKey: @"Type"];
    243     NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: rowOptions owner: controlView userInfo: rowInfo];
    244     [controlView addTrackingArea: area];
    245     [rowInfo release];
    246     [area release];
    247    
    248     //control button
    249     NSRect controlButtonRect = [self controlButtonRectForBounds: cellFrame];
    250     NSTrackingAreaOptions controlOptions = options;
    251     if (NSMouseInRect(mouseLocation, controlButtonRect, [controlView isFlipped]))
    252     {
    253         controlOptions |= NSTrackingAssumeInside;
    254         [(TorrentTableView *)controlView setControlButtonHover: [[userInfo objectForKey: @"Row"] integerValue]];
    255     }
    256    
    257     NSMutableDictionary * controlInfo = [userInfo mutableCopy];
    258     [controlInfo setObject: @"Control" forKey: @"Type"];
    259     area = [[NSTrackingArea alloc] initWithRect: controlButtonRect options: controlOptions owner: controlView
    260                                 userInfo: controlInfo];
    261     [controlView addTrackingArea: area];
    262     [controlInfo release];
    263     [area release];
     234    if ([fDefaults boolForKey: @"SmallView"])
     235    {
     236        NSTrackingAreaOptions rowOptions = options;
     237        if (NSMouseInRect(mouseLocation, cellFrame, [controlView isFlipped]))
     238        {
     239            rowOptions |= NSTrackingAssumeInside;
     240            [(TorrentTableView *)controlView setRowHover: [[userInfo objectForKey: @"Row"] integerValue]];
     241        }
     242       
     243        NSMutableDictionary * rowInfo = [userInfo mutableCopy];
     244        [rowInfo setObject: @"Row" forKey: @"Type"];
     245        NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: cellFrame options: rowOptions owner: controlView userInfo: rowInfo];
     246        [controlView addTrackingArea: area];
     247        [rowInfo release];
     248        [area release];
     249       
     250        //control button
     251        NSRect controlButtonRect = [self controlButtonRectForBounds: cellFrame];
     252        NSTrackingAreaOptions controlOptions = options;
     253        if (NSMouseInRect(mouseLocation, controlButtonRect, [controlView isFlipped]))
     254        {
     255            controlOptions |= NSTrackingAssumeInside;
     256            [(TorrentTableView *)controlView setControlButtonHover: [[userInfo objectForKey: @"Row"] integerValue]];
     257        }
     258       
     259        NSMutableDictionary * controlInfo = [userInfo mutableCopy];
     260        [controlInfo setObject: @"Control" forKey: @"Type"];
     261        area = [[NSTrackingArea alloc] initWithRect: controlButtonRect options: controlOptions owner: controlView
     262                                    userInfo: controlInfo];
     263        [controlView addTrackingArea: area];
     264        [controlInfo release];
     265        [area release];
     266    }
    264267   
    265268    //reveal button
     
    274277    NSMutableDictionary * revealInfo = [userInfo mutableCopy];
    275278    [revealInfo setObject: @"Reveal" forKey: @"Type"];
    276     area = [[NSTrackingArea alloc] initWithRect: revealButtonRect options: revealOptions owner: controlView userInfo: revealInfo];
     279    NSTrackingArea * area = [[NSTrackingArea alloc] initWithRect: revealButtonRect options: revealOptions owner: controlView userInfo: revealInfo];
    277280    [controlView addTrackingArea: area];
    278281    [revealInfo release];
  • trunk/macosx/TorrentTableView.m

    r10402 r10406  
    264264{
    265265    fMouseRow = row;
    266     if (row >= 0 && [fDefaults boolForKey: @"SmallView"])
     266    if (row >= 0)
    267267        [self setNeedsDisplayInRect: [self rectOfRow: row]];
    268268}
Note: See TracChangeset for help on using the changeset viewer.