Customizing PulpFiction’s Dock Badge
Posted February 6th, 2005 @ 10:45am by Erik J. Barzeski
We use a few defaults in PulpFiction to control the badge, and though you can't ever change them in the UI, they're quite accessible to those who what they're doing. The keys are FSSDockBadgeColor, FSSDockBadgeTextColor, and FSSDockBadgePosition. Here are some pertinent code snippets. You should be able to figure out what you need to do to set your own badge colors and positions:
[defaults setObject:[NSArray arrayWithObjects: [NSNumber numberWithFloat:0.0], [NSNumber numberWithFloat:.5], [NSNumber numberWithFloat:0.0], [NSNumber numberWithFloat:1.0], nil] forKey:@"FSSDockBadgeColor"]; [defaults setObject:[NSArray arrayWithObjects:[NSNumber numberWithFloat:1.0], [NSNumber numberWithFloat:1.0], [NSNumber numberWithFloat:1.0], [NSNumber numberWithFloat:1.0], nil] forKey:@"FSSDockBadgeTextColor"]; [defaults setObject:[NSNumber numberWithInt:FSSTopRight] forKey:@"FSSDockBadgePosition"];
As you'll note, "FSSTopRight" isn't a string. So, here's the enum:
typedef enum FSSBadgeCorner { FSSTopRight = 0, FSSTopLeft = 1, FSSBottomRight = 2, FSSBottomLeft = 3 } FSSBadgeCorner;
Customize away! Link to screenshots of your favorite combination of colors and position (and list the numbers you use) in the comments - perhaps we'll change the default.