Changeset 6246


Ignore:
Timestamp:
Jun 24, 2008, 3:59:34 AM (13 years ago)
Author:
livings124
Message:

the progress bar color gradients are now all generated by a single color fed into a method to generate the gradient (more consistent gradient between colors and easier to adjust the gradient look in the future)

Location:
trunk/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/CTGradient/CTGradientAdditions.h

    r5941 r6246  
    2626
    2727@interface CTGradient (ProgressBar)
     28
     29+ (CTGradient *) progressGradientForColor: (NSColor *) color;
     30
    2831+ (CTGradient *)progressWhiteGradient;
    2932+ (CTGradient *)progressGrayGradient;
     
    3639+ (CTGradient *)progressRedGradient;
    3740+ (CTGradient *)progressYellowGradient;
     41
    3842@end
  • trunk/macosx/CTGradient/CTGradientAdditions.m

    r5972 r6246  
    2727@implementation CTGradient (ProgressBar)
    2828
    29 + (CTGradient *)progressWhiteGradient
     29+ (CTGradient *) progressGradientForColor: (NSColor *) color
    3030{
    31     CTGradient *newInstance = [[[self class] alloc] init];
     31    float redComponent = [color redComponent],
     32        greenComponent = [color greenComponent],
     33        blueComponent = [color blueComponent];
    3234   
    3335    CTGradientElement color1;
    34     color1.red = color1.green = color1.blue  = 0.95;
    35     color1.alpha = 1.00;
    36     color1.position = 0;
     36    color1.red = redComponent;
     37    color1.green = greenComponent;
     38    color1.blue = blueComponent;
     39    color1.alpha = 1.0;
     40    color1.position = 0.0;
    3741   
    3842    CTGradientElement color2;
    39     color2.red = color2.green = color2.blue  = 0.83;
    40     color2.alpha = 1.00;
     43    color2.red = redComponent * 0.8736;
     44    color2.green = greenComponent * 0.8736;
     45    color2.blue = blueComponent * 0.8736;
     46    color2.alpha = 1.0;
    4147    color2.position = 0.5;
    4248   
    4349    CTGradientElement color3;
    44     color3.red = color3.green = color3.blue  = 0.95;
    45     color3.alpha = 1.00;
     50    color3.red = redComponent;
     51    color3.green = greenComponent;
     52    color3.blue = blueComponent;
     53    color3.alpha = 1.0;
    4654    color3.position = 0.5;
    4755   
    4856    CTGradientElement color4;
    49     color4.red = color4.green = color4.blue  = 0.92;
    50     color4.alpha = 1.00;
    51     color4.position = 1;
     57    color4.red = redComponent * 0.9684;
     58    color4.green = greenComponent * 0.9684;
     59    color4.blue = blueComponent * 0.9684;
     60    color4.alpha = 1.0;
     61    color4.position = 1.0;
    5262   
     63    CTGradient * newInstance = [[[self class] alloc] init];
    5364    [newInstance addElement:&color1];
    5465    [newInstance addElement:&color2];
     
    5970}
    6071
     72+ (CTGradient *)progressWhiteGradient
     73{
     74    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.95 green: 0.95 blue: 0.95 alpha: 1.0]];
     75}
     76
    6177+ (CTGradient *)progressGrayGradient
    6278{
    63     CTGradient *newInstance = [[[self class] alloc] init];
    64    
    65     CTGradientElement color1;
    66     color1.red = color1.green = color1.blue  = 0.7;
    67     color1.alpha = 1.00;
    68     color1.position = 0;
    69    
    70     CTGradientElement color2;
    71     color2.red = color2.green = color2.blue  = 0.6;
    72     color2.alpha = 1.00;
    73     color2.position = 0.5;
    74    
    75     CTGradientElement color3;
    76     color3.red = color3.green = color3.blue  = 0.7;
    77     color3.alpha = 1.00;
    78     color3.position = 0.5;
    79    
    80     CTGradientElement color4;
    81     color4.red = color4.green = color4.blue  = 0.7;
    82     color4.alpha = 1.00;
    83     color4.position = 1;
    84    
    85     [newInstance addElement:&color1];
    86     [newInstance addElement:&color2];
    87     [newInstance addElement:&color3];
    88     [newInstance addElement:&color4];
    89    
    90     return [newInstance autorelease];
     79    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.7 green: 0.7 blue: 0.7 alpha: 1.0]];
    9180}
    9281
    9382+ (CTGradient *)progressLightGrayGradient
    9483{
    95     CTGradient *newInstance = [[[self class] alloc] init];
    96    
    97     CTGradientElement color1;
    98     color1.red = color1.green = color1.blue  = 0.87;
    99     color1.alpha = 1.00;
    100     color1.position = 0;
    101    
    102     CTGradientElement color2;
    103     color2.red = color2.green = color2.blue  = 0.754;
    104     color2.alpha = 1.00;
    105     color2.position = 0.5;
    106    
    107     CTGradientElement color3;
    108     color3.red = color3.green = color3.blue  = 0.87;
    109     color3.alpha = 1.00;
    110     color3.position = 0.5;
    111    
    112     CTGradientElement color4;
    113     color4.red = color4.green = color4.blue  = 0.87;
    114     color4.alpha = 1.00;
    115     color4.position = 1;
    116    
    117     [newInstance addElement:&color1];
    118     [newInstance addElement:&color2];
    119     [newInstance addElement:&color3];
    120     [newInstance addElement:&color4];
    121    
    122     return [newInstance autorelease];
     84    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.87 green: 0.87 blue: 0.87 alpha: 1.0]];
    12385}
    12486
    12587+ (CTGradient *)progressBlueGradient
    12688{
    127     CTGradient *newInstance = [[[self class] alloc] init];
    128    
    129     CTGradientElement color1;
    130     color1.red = 0.416;
    131     color1.green = 0.788;
    132     color1.blue  = 0.97;
    133     color1.alpha = 1.00;
    134     color1.position = 0;
    135    
    136     CTGradientElement color2;
    137     color2.red = 0.274;
    138     color2.green = 0.52;
    139     color2.blue  = 0.94;
    140     color2.alpha = 1.00;
    141     color2.position = 0.5;
    142    
    143     CTGradientElement color3;
    144     color3.red = 0.372;
    145     color3.green = 0.635;
    146     color3.blue  = 0.98;
    147     color3.alpha = 1.00;
    148     color3.position = 0.5;
    149    
    150     CTGradientElement color4;
    151     color4.red = 0.396;
    152     color4.green = 0.66;
    153     color4.blue  = 1.00;
    154     color4.alpha = 1.00;
    155     color4.position = 1;
    156    
    157     [newInstance addElement:&color1];
    158     [newInstance addElement:&color2];
    159     [newInstance addElement:&color3];
    160     [newInstance addElement:&color4];
    161    
    162     return [newInstance autorelease];
     89    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.373 green: 0.698 blue: 0.972 alpha: 1.0]];
    16390}
    16491
    16592+ (CTGradient *)progressDarkBlueGradient
    16693{
    167     CTGradient *newInstance = [[[self class] alloc] init];
    168    
    169     CTGradientElement color1;
    170     color1.red = 0.616;
    171     color1.green = 0.722;
    172     color1.blue  = 0.776;
    173     color1.alpha = 1.00;
    174     color1.position = 0;
    175    
    176     CTGradientElement color2;
    177     color2.red = 0.525;
    178     color2.green = 0.631;
    179     color2.blue  = 0.737;
    180     color2.alpha = 1.00;
    181     color2.position = 0.5;
    182    
    183     CTGradientElement color3;
    184     color3.red = 0.651;
    185     color3.green = 0.725;
    186     color3.blue  = 0.804;
    187     color3.alpha = 1.00;
    188     color3.position = 0.5;
    189    
    190     CTGradientElement color4;
    191     color4.red = 0.659;
    192     color4.green = 0.733;
    193     color4.blue  = 0.800;
    194     color4.alpha = 1.00;
    195     color4.position = 1;
    196    
    197     [newInstance addElement:&color1];
    198     [newInstance addElement:&color2];
    199     [newInstance addElement:&color3];
    200     [newInstance addElement:&color4];
    201    
    202     return [newInstance autorelease];
     94    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.616 green: 0.722 blue: 0.776 alpha: 1.0]];
    20395}
    20496
    20597+ (CTGradient *)progressGreenGradient
    20698{
    207     CTGradient *newInstance = [[[self class] alloc] init];
    208    
    209     CTGradientElement color1;
    210     color1.red = 0.270;
    211     color1.green = 0.89;
    212     color1.blue  = 0.35;
    213     color1.alpha = 1.00;
    214     color1.position = 0;
    215    
    216     CTGradientElement color2;
    217     color2.red = 0.180;
    218     color2.green = 0.71;
    219     color2.blue  = 0.23;
    220     color2.alpha = 1.00;
    221     color2.position = 0.5;
    222    
    223     CTGradientElement color3;
    224     color3.red = 0.420;
    225     color3.green = 0.86;
    226     color3.blue  = 0.32;
    227     color3.alpha = 1.00;
    228     color3.position = 0.5;
    229    
    230     CTGradientElement color4;
    231     color4.red = 0.466;
    232     color4.green = 0.89;
    233     color4.blue  = 0.34;
    234     color4.alpha = 1.00;
    235     color4.position = 1;
    236    
    237     [newInstance addElement:&color1];
    238     [newInstance addElement:&color2];
    239     [newInstance addElement:&color3];
    240     [newInstance addElement:&color4];
    241    
    242     return [newInstance autorelease];
     99    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.384 green: 0.847 blue: 0.310 alpha: 1.0]];
    243100}
    244101
    245102+ (CTGradient *)progressLightGreenGradient
    246103{
    247     CTGradient *newInstance = [[[self class] alloc] init];
    248    
    249     CTGradientElement color1;
    250     color1.red = 0.522;
    251     color1.green = 0.894;
    252     color1.blue  = 0.565;
    253     color1.alpha = 1.00;
    254     color1.position = 0;
    255    
    256     CTGradientElement color2;
    257     color2.red = 0.373;
    258     color2.green = 0.780;
    259     color2.blue  = 0.408;
    260     color2.alpha = 1.00;
    261     color2.position = 0.5;
    262    
    263     CTGradientElement color3;
    264     color3.red = 0.659;
    265     color3.green = 0.918;
    266     color3.blue  = 0.604;
    267     color3.alpha = 1.00;
    268     color3.position = 0.5;
    269    
    270     CTGradientElement color4;
    271     color4.red = 0.678;
    272     color4.green = 0.929;
    273     color4.blue  = 0.608;
    274     color4.alpha = 1.00;
    275     color4.position = 1;
    276    
    277     [newInstance addElement:&color1];
    278     [newInstance addElement:&color2];
    279     [newInstance addElement:&color3];
    280     [newInstance addElement:&color4];
    281    
    282     return [newInstance autorelease];
     104    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.780 green: 0.894 blue: 0.729 alpha: 1.0]];
    283105}
    284106
    285107+ (CTGradient *)progressDarkGreenGradient
    286108{
    287     CTGradient *newInstance = [[[self class] alloc] init];
    288    
    289     CTGradientElement color1;
    290     color1.red = 0.627;
    291     color1.green = 0.714;
    292     color1.blue  = 0.639;
    293     color1.alpha = 1.00;
    294     color1.position = 0;
    295    
    296     CTGradientElement color2;
    297     color2.red = 0.545;
    298     color2.green = 0.635;
    299     color2.blue  = 0.561;
    300     color2.alpha = 1.00;
    301     color2.position = 0.5;
    302    
    303     CTGradientElement color3;
    304     color3.red = 0.690;
    305     color3.green = 0.745;
    306     color3.blue  = 0.675;
    307     color3.alpha = 1.00;
    308     color3.position = 0.5;
    309    
    310     CTGradientElement color4;
    311     color4.red = 0.694;
    312     color4.green = 0.741;
    313     color4.blue  = 0.678;
    314     color4.alpha = 1.00;
    315     color4.position = 1;
    316    
    317     [newInstance addElement:&color1];
    318     [newInstance addElement:&color2];
    319     [newInstance addElement:&color3];
    320     [newInstance addElement:&color4];
    321    
    322     return [newInstance autorelease];
     109    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.627 green: 0.714 blue: 0.639 alpha: 1.0]];
    323110}
    324111
    325112+ (CTGradient *)progressRedGradient
    326113{
    327     CTGradient *newInstance = [[[self class] alloc] init];
    328    
    329         CTGradientElement color1;
    330     color1.red = 0.9;
    331         color1.green = color1.blue  = 0.5;
    332     color1.alpha = 1.00;
    333     color1.position = 0;
    334    
    335     CTGradientElement color2;
    336     color2.red = 0.9;
    337         color2.green = color2.blue  = 0.4;
    338     color2.alpha = 1.00;
    339     color2.position = 0.5;
    340    
    341     CTGradientElement color3;
    342     color3.red = 0.9;
    343         color3.green = color3.blue  = 0.5;
    344     color3.alpha = 1.00;
    345     color3.position = 0.5;
    346    
    347     CTGradientElement color4;
    348     color4.red = 0.9;
    349         color4.green = color4.blue  = 0.5;
    350     color4.alpha = 1.00;
    351     color4.position = 1;
    352    
    353     [newInstance addElement:&color1];
    354     [newInstance addElement:&color2];
    355     [newInstance addElement:&color3];
    356     [newInstance addElement:&color4];
    357    
    358     return [newInstance autorelease];
    359 
     114    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.902 green: 0.439 blue: 0.451 alpha: 1.0]];
    360115}
    361116
    362117+ (CTGradient *)progressYellowGradient
    363118{
    364     CTGradient *newInstance = [[[self class] alloc] init];
    365    
    366     CTGradientElement color1;
    367     color1.red = 0.933;
    368     color1.green = 0.831;
    369     color1.blue  = 0.227;
    370     color1.alpha = 1.00;
    371     color1.position = 1;
    372    
    373     CTGradientElement color2;
    374     color2.red = 0.965;
    375     color2.green = 0.737;
    376     color2.blue  = 0.086;
    377     color2.alpha = 1.00;
    378     color2.position = 0.5;
    379    
    380     CTGradientElement color3;
    381     color3.red = 0.965;
    382     color3.green = 0.831;
    383     color3.blue  = 0.169;
    384     color3.alpha = 1.00;
    385     color3.position = 0.5;
    386    
    387     CTGradientElement color4;
    388     color4.red = 0.965;
    389     color4.green = 0.831;
    390     color4.blue  = 0.169;
    391     color4.alpha = 1.00;
    392     color4.position = 0;
    393    
    394     [newInstance addElement:&color1];
    395     [newInstance addElement:&color2];
    396     [newInstance addElement:&color3];
    397     [newInstance addElement:&color4];
    398    
    399     return [newInstance autorelease];
     119    return [[self class] progressGradientForColor: [NSColor colorWithCalibratedRed: 0.933 green: 0.890 blue: 0.243 alpha: 1.0]];
    400120}
    401121
  • trunk/macosx/CreatorWindowController.m

    r6221 r6246  
    120120                [fDefaults setObject: fTrackers forKey: @"CreatorTrackers"];
    121121            }
    122         }NSLog([fTrackers description]);
     122        }
    123123    }
    124124    return self;
  • trunk/macosx/English.lproj/MainMenu.xib

    r6023 r6246  
    44                <int key="IBDocument.SystemTarget">1050</int>
    55                <string key="IBDocument.SystemVersion">9D34</string>
    6                 <string key="IBDocument.InterfaceBuilderVersion">667</string>
     6                <string key="IBDocument.InterfaceBuilderVersion">670</string>
    77                <string key="IBDocument.AppKitVersion">949.33</string>
    88                <string key="IBDocument.HIToolboxVersion">352.00</string>
     
    1010                        <bool key="EncodedWithXMLCoder">YES</bool>
    1111                        <integer value="2"/>
    12                         <integer value="81"/>
     12                        <integer value="1603"/>
     13                        <integer value="1480"/>
    1314                </object>
    1415                <object class="NSArray" key="IBDocument.PluginDependencies">
     
    9293                                                                        <reference key="NSMenu" ref="97165992"/>
    9394                                                                        <bool key="NSIsHidden">YES</bool>
    94                                                                         <string key="NSTitle">Action Menu</string>
     95                                                                        <string key="NSTitle"/>
    9596                                                                        <string key="NSKeyEquiv"/>
    9697                                                                        <int key="NSKeyEquivModMask">1048576</int>
     
    34073408                        </object>
    34083409                        <object class="NSCustomView" id="492482618">
    3409                                 <nil key="NSNextResponder"/>
     3410                                <reference key="NSNextResponder"/>
    34103411                                <int key="NSvFlags">266</int>
    34113412                                <object class="NSMutableArray" key="NSSubviews">
     
    36423643                                </object>
    36433644                                <string key="NSFrameSize">{400, 21}</string>
     3645                                <reference key="NSSuperview"/>
    36443646                                <string key="NSClassName">StatusBarView</string>
    36453647                                <string key="NSExtension">NSView</string>
    36463648                        </object>
    36473649                        <object class="NSCustomView" id="793806362">
    3648                                 <nil key="NSNextResponder"/>
     3650                                <reference key="NSNextResponder"/>
    36493651                                <int key="NSvFlags">266</int>
    36503652                                <object class="NSMutableArray" key="NSSubviews">
     
    39313933                                </object>
    39323934                                <string key="NSFrameSize">{457, 23}</string>
     3935                                <reference key="NSSuperview"/>
    39333936                                <string key="NSClassName">StatusBarView</string>
    39343937                                <string key="NSExtension">NSView</string>
  • trunk/macosx/InfoWindowController.m

    r6244 r6246  
    437437        [fDateCreatedField setObjectValue: [torrent dateCreated]];
    438438       
    439         BOOL publicTorrent = [torrent publicTorrent];
    440         [fTorrentLocationField setStringValue: publicTorrent
    441                     ? [[torrent publicTorrentLocation] stringByAbbreviatingWithTildeInPath]
    442                     : NSLocalizedString(@"Transmission Support Folder", "Torrent -> location when deleting original")];
    443         if (publicTorrent)
    444             [fTorrentLocationField setToolTip: [[torrent publicTorrentLocation] stringByAppendingFormat: @"\n\n%@",
    445                                                 [torrent torrentLocation]]];
     439        if ([torrent publicTorrent])
     440        {
     441            NSString * location = [torrent publicTorrentLocation];
     442            [fTorrentLocationField setStringValue: [location stringByAbbreviatingWithTildeInPath]];
     443            [fTorrentLocationField setToolTip: [location stringByAppendingFormat: @"\n\n%@", [torrent torrentLocation]]];
     444        }
    446445        else
     446        {
     447            [fTorrentLocationField setStringValue: NSLocalizedString(@"Transmission Support Folder", "Inspector -> torrent location")];
    447448            [fTorrentLocationField setToolTip: [torrent torrentLocation]];
     449        }
    448450       
    449451        [fDateAddedField setObjectValue: [torrent dateAdded]];
  • trunk/macosx/Torrent.m

    r6244 r6246  
    383383
    384384- (float) progressStopRatio
    385 {
     385{return 0.5;
    386386    float stopRatio, ratio;
    387387    if ((stopRatio = [self actualStopRatio]) == INVALID || (ratio = [self ratio]) >= stopRatio)
Note: See TracChangeset for help on using the changeset viewer.