mirror of
https://github.com/transmission/transmission.git
synced 2025-12-25 04:45:56 +00:00
play around with the group coloring a bit
This commit is contained in:
@@ -40,7 +40,7 @@ typedef enum
|
||||
|
||||
- (void) saveGroups;
|
||||
|
||||
- (CTGradient *) gradientForColor: (NSColor *) color;
|
||||
- (CTGradient *) gradientForPreviewColor: (NSColor *) color;
|
||||
- (void) changeColor: (id) sender;
|
||||
|
||||
@end
|
||||
@@ -128,7 +128,7 @@ GroupsWindowController * fGroupsWindowInstance = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (CTGradient *) gradientForIndex: (int) index
|
||||
- (NSColor *) colorForIndex: (int) index
|
||||
{
|
||||
if (index < 0)
|
||||
return nil;
|
||||
@@ -137,7 +137,7 @@ GroupsWindowController * fGroupsWindowInstance = nil;
|
||||
NSDictionary * dict;
|
||||
while ((dict = [enumerator nextObject]))
|
||||
if ([[dict objectForKey: @"Index"] intValue] == index)
|
||||
return [self gradientForColor: [dict objectForKey: @"Color"]];
|
||||
return [dict objectForKey: @"Color"];
|
||||
|
||||
return nil;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ GroupsWindowController * fGroupsWindowInstance = nil;
|
||||
{
|
||||
NSString * identifier = [tableColumn identifier];
|
||||
if ([identifier isEqualToString: @"Color"])
|
||||
return [self gradientForColor: [[fGroups objectAtIndex: row] objectForKey: @"Color"]];
|
||||
return [self gradientForPreviewColor: [[fGroups objectAtIndex: row] objectForKey: @"Color"]];
|
||||
else
|
||||
return [[fGroups objectAtIndex: row] objectForKey: @"Name"];
|
||||
}
|
||||
@@ -348,7 +348,7 @@ GroupsWindowController * fGroupsWindowInstance = nil;
|
||||
NSImage * icon = [[NSImage alloc] initWithSize: NSMakeSize(16.0, 16.0)];
|
||||
|
||||
[icon lockFocus];
|
||||
[[self gradientForColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 270.0];
|
||||
[[self gradientForPreviewColor: [dict objectForKey: @"Color"]] fillBezierPath: bp angle: 270.0];
|
||||
[icon unlockFocus];
|
||||
|
||||
[item setImage: icon];
|
||||
@@ -372,7 +372,7 @@ GroupsWindowController * fGroupsWindowInstance = nil;
|
||||
[[NSUserDefaults standardUserDefaults] setObject: [NSArchiver archivedDataWithRootObject: fGroups] forKey: @"Groups"];
|
||||
}
|
||||
|
||||
- (CTGradient *) gradientForColor: (NSColor *) color
|
||||
- (CTGradient *) gradientForPreviewColor: (NSColor *) color
|
||||
{
|
||||
return [CTGradient gradientWithBeginningColor: [color blendedColorWithFraction: 0.7 ofColor: [NSColor whiteColor]]
|
||||
endingColor: [color blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]]];
|
||||
|
||||
Reference in New Issue
Block a user