~ubuntu-branches/ubuntu/maverick/transmission/maverick

« back to all changes in this revision

Viewing changes to macosx/FileOutlineView.m

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-05-22 21:57:30 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (2.1.18 sid) (1.3.8 upstream)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: james.westby@ubuntu.com-20090522215730-ly5kgv5aw9ig2u82
Tags: upstream-1.61
ImportĀ upstreamĀ versionĀ 1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: FileOutlineView.m 7018 2008-11-02 14:04:57Z livings124 $
 
2
 * $Id: FileOutlineView.m 7659 2009-01-10 23:37:37Z livings124 $
3
3
 * 
4
 
 * Copyright (c) 2007-2008 Transmission authors and contributors
 
4
 * Copyright (c) 2007-2009 Transmission authors and contributors
5
5
 *
6
6
 * Permission is hereby granted, free of charge, to any person obtaining a
7
7
 * copy of this software and associated documentation files (the "Software"),
28
28
#import "Torrent.h"
29
29
#import "FileListNode.h"
30
30
#import "QuickLookController.h"
31
 
#import "CTGradient.h"
32
31
 
33
32
@implementation FileOutlineView
34
33
 
47
46
    
48
47
    NSColor * endingColor = [NSColor colorWithCalibratedRed: 217.0/255.0 green: 250.0/255.0 blue: 211.0/255.0 alpha: 1.0];
49
48
    NSColor * beginningColor = [endingColor blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]];
50
 
    fHighPriorityGradient = [[CTGradient gradientWithBeginningColor: beginningColor endingColor: endingColor] retain];
 
49
    fHighPriorityGradient = [[NSGradient alloc] initWithStartingColor: beginningColor endingColor: endingColor];
51
50
    
52
51
    endingColor = [NSColor colorWithCalibratedRed: 255.0/255.0 green: 243.0/255.0 blue: 206.0/255.0 alpha: 1.0];
53
52
    beginningColor = [endingColor blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]];
54
 
    fLowPriorityGradient = [[CTGradient gradientWithBeginningColor: beginningColor endingColor: endingColor] retain];
 
53
    fLowPriorityGradient = [[NSGradient alloc] initWithStartingColor: beginningColor endingColor: endingColor];
55
54
    
56
55
    endingColor = [NSColor colorWithCalibratedRed: 225.0/255.0 green: 218.0/255.0 blue: 255.0/255.0 alpha: 1.0];
57
56
    beginningColor = [endingColor blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]];
58
 
    fMixedPriorityGradient = [[CTGradient gradientWithBeginningColor: beginningColor endingColor: endingColor] retain];
 
57
    fMixedPriorityGradient = [[NSGradient alloc] initWithStartingColor: beginningColor endingColor: endingColor];
59
58
    
60
59
    fMouseRow = -1;
61
60
}
127
126
{
128
127
    [super updateTrackingAreas];
129
128
    
130
 
    NSEnumerator * enumerator = [[self trackingAreas] objectEnumerator];
131
 
    NSTrackingArea * area;
132
 
    while ((area = [enumerator nextObject]))
 
129
    for (NSTrackingArea * area in [self trackingAreas])
133
130
    {
134
131
        if ([area owner] == self && [[area userInfo] objectForKey: @"Row"])
135
132
            [self removeTrackingArea: area];
185
182
        
186
183
        if ([fTorrent checkForFiles: indexes] != NSOffState)
187
184
        {
188
 
            CTGradient * gradient = nil;
 
185
            NSGradient * gradient = nil;
189
186
            
190
187
            NSSet * priorities = [fTorrent filePrioritiesForIndexes: indexes];
191
188
            int count = [priorities count];
209
206
            {
210
207
                NSRect rect = [self rectOfRow: row];
211
208
                rect.size.height -= 1.0;
212
 
                [gradient fillRect: rect angle: 90];
 
209
                [gradient drawInRect: rect angle: 90];
213
210
            }
214
211
        }
215
212
    }