Changeset 595


Ignore:
Timestamp:
Jul 16, 2006, 3:45:55 AM (16 years ago)
Author:
livings124
Message:

Show green in top part of advanced bar to represent available but not-yet downloaded (patch from denisx on irc).

Make filter bar font larger.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/BarButton.m

    r591 r595  
    129129    NSDictionary * normalAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    130130                [NSColor blackColor], NSForegroundColorAttributeName,
    131                 [NSFont messageFontOfSize: 11.0], NSFontAttributeName,
     131                [NSFont messageFontOfSize: 12.0], NSFontAttributeName,
    132132                stringShadow, NSShadowAttributeName, nil];
    133133    NSDictionary * highlightedAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
    134134                [NSColor whiteColor], NSForegroundColorAttributeName,
    135                 [NSFont messageFontOfSize: 11.0], NSFontAttributeName,
     135                [NSFont messageFontOfSize: 12.0], NSFontAttributeName,
    136136                stringShadow, NSShadowAttributeName, nil];
    137137   
  • trunk/macosx/TorrentCell.m

    r561 r595  
    186186    int width = widthFloat; //integers for bars
    187187   
    188     NSBitmapImageRep * bitmap = [[NSBitmapImageRep alloc]
    189         initWithBitmapDataPlanes: nil pixelsWide: width
    190         pixelsHigh: BAR_HEIGHT bitsPerSample: 8 samplesPerPixel: 4
    191         hasAlpha: YES isPlanar: NO colorSpaceName:
    192         NSCalibratedRGBColorSpace bytesPerRow: 0 bitsPerPixel: 0];
     188    NSBitmapImageRep * bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nil
     189        pixelsWide: width pixelsHigh: BAR_HEIGHT bitsPerSample: 8 samplesPerPixel: 4 hasAlpha: YES
     190        isPlanar: NO colorSpaceName: NSCalibratedRGBColorSpace bytesPerRow: 0 bitsPerPixel: 0];
    193191
    194192    int h, w;
     
    197195    int bytesPerRow = [bitmap bytesPerRow];
    198196
    199     /* Left and right borders */
     197    //left and right borders
    200198    p = (uint32_t *) bitmapData;
    201     for( h = 0; h < BAR_HEIGHT; h++ )
     199    for(h = 0; h < BAR_HEIGHT; h++)
    202200    {
    203201        p[0] = kBorder[h];
     
    206204    }
    207205
    208     int8_t * pieces = malloc( width );
     206    int8_t * pieces = malloc(width);
    209207    [fTorrent getAvailability: pieces size: width];
    210 
    211     /* First two lines: dark blue to show progression */
    212     int end  = lrintf( floor( [fTorrent progress] * ( width - 2 ) ) );
    213     for( h = 0; h < 2; h++ )
    214     {
    215         p = (uint32_t *) ( bitmapData + h * bytesPerRow ) + 1;
    216         for( w = 0; w < end; w++ )
    217             p[w] = kBlue4;
    218         for( w = end; w < width - 2; w++ )
    219             p[w] = kBack[h];
    220     }
    221 
    222     /* Lines 2 to 14: blue or grey depending on whether
    223        we have the piece or not */
     208    int avail = 0;
     209    for (w = 0; w < width; w++)
     210        if (pieces[w] != 0)
     211            avail++;
     212
     213    //first two lines: dark blue to show progression, green to show available
     214    int end = lrintf(floor([fTorrent progress] * (width - 2)));
     215    p = (uint32_t *) (bitmapData) + 1;
     216
     217    for (w = 0; w < end; w++)
     218    {
     219        p[w] = kBlue4;
     220        p[w + bytesPerRow / 4] = kBlue4;
     221    }
     222    for (; w < avail; w++)
     223    {
     224        p[w] = kGreen;
     225        p[w + bytesPerRow / 4] = kGreen;
     226    }
     227    for (; w < width - 2; w++)
     228    {
     229        p[w] = kBack[0];
     230        p[w + bytesPerRow / 4] = kBack[1];
     231    }
     232   
     233    //lines 2 to 14: blue or grey depending on whether we have the piece or not
    224234    uint32_t color;
    225235    for( w = 0; w < width - 2; w++ )
    226236    {
    227         /* Point to pixel ( 2 + w, 2 ). We will then draw
    228            "vertically" */
     237        //point to pixel ( 2 + w, 2 ). We will then draw "vertically"
    229238        p = (uint32_t *) ( bitmapData + 2 * bytesPerRow ) + 1 + w;
    230239
Note: See TracChangeset for help on using the changeset viewer.