Changeset 4194


Ignore:
Timestamp:
Dec 18, 2007, 2:55:14 AM (14 years ago)
Author:
livings124
Message:

play around with the group coloring a bit

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/GroupsWindowController.h

    r4192 r4194  
    3838
    3939+ (GroupsWindowController *) groupsController;
    40 - (CTGradient *) gradientForIndex: (int) index;
     40
     41- (NSColor *) colorForIndex: (int) index;
    4142
    4243- (int) orderValueForIndex: (int) index;
  • trunk/macosx/GroupsWindowController.m

    r4193 r4194  
    4141- (void) saveGroups;
    4242
    43 - (CTGradient *) gradientForColor: (NSColor *) color;
     43- (CTGradient *) gradientForPreviewColor: (NSColor *) color;
    4444- (void) changeColor: (id) sender;
    4545
     
    129129}
    130130
    131 - (CTGradient *) gradientForIndex: (int) index
     131- (NSColor *) colorForIndex: (int) index
    132132{
    133133    if (index < 0)
     
    138138    while ((dict = [enumerator nextObject]))
    139139        if ([[dict objectForKey: @"Index"] intValue] == index)
    140             return [self gradientForColor: [dict objectForKey: @"Color"]];
     140            return [dict objectForKey: @"Color"];
    141141   
    142142    return nil;
     
    164164    NSString * identifier = [tableColumn identifier];
    165165    if ([identifier isEqualToString: @"Color"])
    166         return [self gradientForColor: [[fGroups objectAtIndex: row] objectForKey: @"Color"]];
     166        return [self gradientForPreviewColor: [[fGroups objectAtIndex: row] objectForKey: @"Color"]];
    167167    else
    168168        return [[fGroups objectAtIndex: row] objectForKey: @"Name"];
     
    349349       
    350350        [icon lockFocus];
    351         [[self gradientForColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 270.0];
     351        [[self gradientForPreviewColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 270.0];
    352352        [icon unlockFocus];
    353353       
     
    373373}
    374374
    375 - (CTGradient *) gradientForColor: (NSColor *) color
     375- (CTGradient *) gradientForPreviewColor: (NSColor *) color
    376376{
    377377    return [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0.7 ofColor: [NSColor whiteColor]]
  • trunk/macosx/TorrentCell.m

    r4193 r4194  
    5151#define PADDING_BETWEEN_TITLE_AND_BAR_MIN 3.0
    5252#define PADDING_BETWEEN_BAR_AND_STATUS 2.0
     53
     54#define WIDTH_GROUP_FADE 16.0
    5355#define WIDTH_GROUP 38.0
    5456#define WIDTH_GROUP_MIN 22.0
     
    210212    if (groupValue != -1)
    211213    {
     214        NSColor * color = [[[GroupsWindowController groupsController] colorForIndex: groupValue]
     215                            blendedColorWithFraction: 0.3 ofColor: [NSColor whiteColor]];
     216       
    212217        NSRect groupRect = cellFrame;
    213         groupRect.size.width = minimal ? WIDTH_GROUP_MIN : WIDTH_GROUP;
     218        groupRect.size.width = (minimal ? WIDTH_GROUP_MIN : WIDTH_GROUP) - WIDTH_GROUP_FADE;
    214219        groupRect.origin.x -= 1.0;
    215220        groupRect.size.height += 1.0;
    216221        groupRect.origin.y -= 1.0;
    217222       
    218         [[[GroupsWindowController groupsController] gradientForIndex: groupValue] fillRect: groupRect angle: 90];
     223        [color set];
     224        NSRectFill(groupRect);
     225       
     226        groupRect.origin.x += groupRect.size.width;
     227        groupRect.size.width = WIDTH_GROUP_FADE;
     228       
     229        CTGradient * gradient = [CTGradient gradientWithBeginningColor: color endingColor: [color colorWithAlphaComponent: 0.0]];
     230        [gradient fillRect: groupRect angle: 0];
    219231    }
    220232   
Note: See TracChangeset for help on using the changeset viewer.