Changeset 5946


Ignore:
Timestamp:
May 27, 2008, 4:07:12 PM (14 years ago)
Author:
livings124
Message:

simplify the drawing of group colors for transfers

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.h

    r5943 r5946  
    3535            fHoverControl, fHoverReveal, fHoverAction;
    3636   
    37     NSColor * fBarOverlayColor;
     37    NSColor * fBarBorderColor;
    3838    CTGradient * fWhiteGradient, * fGrayGradient, * fLightGrayGradient, * fBlueGradient, * fDarkBlueGradient,
    3939                * fGreenGradient, * fLightGreenGradient, * fDarkGreenGradient, * fYellowGradient, * fRedGradient;
  • trunk/macosx/TorrentCell.m

    r5945 r5946  
    107107        fOrangeColor = [[NSColor orangeColor] retain];
    108108       
    109         fBarOverlayColor = [[NSColor colorWithDeviceWhite: 0.0 alpha: 0.2] retain];
     109        fBarBorderColor = [[NSColor colorWithDeviceWhite: 0.0 alpha: 0.2] retain];
    110110    }
    111111        return self;
     
    426426    if (groupValue != -1)
    427427    {
    428         NSRect groupRect = NSInsetRect(iconRect, -2.0, -3.0);
     428        NSRect groupRect = NSInsetRect(iconRect, -1.0, -2.0);
    429429        if (!minimal)
    430430        {
     
    432432            groupRect.origin.y--;
    433433        }
    434        
    435         NSColor * groupColor = [[GroupsController groups] colorForIndex: groupValue];
     434        float radius = minimal ? 3.0 : 6.0;
     435       
     436        NSColor * groupColor = [[GroupsController groups] colorForIndex: groupValue],
     437                * darkGroupColor = [groupColor blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]];
    436438       
    437439        //border
    438         NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: groupRect radius: 6.0];
    439         CTGradient * gradient = [CTGradient gradientWithBeginningColor: [groupColor blendedColorWithFraction: 0.45 ofColor:
    440                                 [NSColor whiteColor]] endingColor: groupColor];
    441         [gradient fillBezierPath: bp angle: 90.0];
     440        NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: groupRect radius: radius];
     441        [darkGroupColor set];
     442        [bp setLineWidth: 1.5];
     443        [bp stroke];
    442444       
    443445        //inside
    444         bp = [NSBezierPath bezierPathWithRoundedRect: NSInsetRect(groupRect, 1.0, 1.0) radius: 6.0];
    445         gradient = [CTGradient gradientWithBeginningColor: [groupColor blendedColorWithFraction: 0.65 ofColor: [NSColor whiteColor]]
    446                     endingColor: [groupColor blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]];
     446        bp = [NSBezierPath bezierPathWithRoundedRect: groupRect radius: radius];
     447        CTGradient * gradient = [CTGradient gradientWithBeginningColor: [groupColor blendedColorWithFraction: 0.7
     448                                    ofColor: [NSColor whiteColor]] endingColor: darkGroupColor];
    447449        [gradient fillBezierPath: bp angle: 90.0];
    448450    }
     
    600602    }
    601603   
    602     [fBarOverlayColor set];
     604    [fBarBorderColor set];
    603605    [NSBezierPath strokeRect: NSInsetRect(barRect, 0.5, 0.5)];
    604606}
Note: See TracChangeset for help on using the changeset viewer.