Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Icons #1129

Merged
merged 8 commits into from Sep 21, 2012
7 changes: 4 additions & 3 deletions Quicksilver/Code-QuickStepCore/QSBadgeImage.m
Expand Up @@ -41,11 +41,12 @@ - (void)drawBadgeForIconRect:(NSRect)rect {
[self drawInRect:alignRectInRect(countImageRect, rect, 3) fromRect:countImageRect operation:NSCompositeSourceOver fraction:1.0];
}

- (void)drawInRect:(NSRect)rect fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta {
[super drawInRect:rect fromRect:rectFromSize([self size]) operation:op fraction:delta];
- (void)drawInRect:(NSRect)rect fromRect:(NSRect)fromRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta respectFlipped:(BOOL)respectContextIsFlipped hints:(NSDictionary *)hints {

[super drawInRect:rect fromRect:rectFromSize([self size]) operation:op fraction:delta respectFlipped:respectContextIsFlipped hints:hints];

NSString *numString = [NSString stringWithFormat:@"%ld", (long)count];
NSRect textRect = NSInsetRect(rect, NSHeight(rect) /4, NSHeight(rect)/4);
NSRect textRect = NSInsetRect(rect, NSHeight(rect) /3.5, NSHeight(rect)/4);
NSDictionary *numAttributes = [numString attributesToFitNumbersInRect:textRect withAttributes:countBadgeTextAttributes];

NSRect glyphRect = rectFromSize([numString sizeWithAttributes:numAttributes]);
Expand Down
2 changes: 1 addition & 1 deletion Quicksilver/Code-QuickStepCore/QSObject.m
Expand Up @@ -296,7 +296,7 @@ + (id)objectByMergingObjects:(NSArray *)objects {
[object guessName];
else
// fall back on setting a simple name
[object setName:@"combined objects"];
[object setName:NSLocalizedString(@"Combined Objects", nil)];
return object;
}

Expand Down
40 changes: 3 additions & 37 deletions Quicksilver/Code-QuickStepInterface/QSObjectCell.m
Expand Up @@ -18,39 +18,6 @@

#define countBadgeTextAttributes [NSDictionary dictionaryWithObjectsAndKeys:[NSFont boldSystemFontOfSize:24] , NSFontAttributeName, [NSColor whiteColor] , NSForegroundColorAttributeName, nil]


NSImage *QSBadgeImageForCount(NSInteger count) {
if (count <= 1) return nil;
NSImage *badgeImage = nil;
NSString *numString = [NSString stringWithFormat:@"%ld", (long)count];
if ([numString length] <3)
badgeImage = [QSResourceManager imageNamed:@"dragBadge1-2"];
else if ([numString length] <4)
badgeImage = [QSResourceManager imageNamed:@"dragBadge3"];
else if ([numString length] <5)
badgeImage = [QSResourceManager imageNamed:@"dragBadge4"];
else
badgeImage = [QSResourceManager imageNamed:@"dragBadge5"];

if (!badgeImage) return nil;
return badgeImage;
}

void QSDrawCountBadgeInRect(NSImage *countImage, NSRect badgeRect, NSInteger count) {
[countImage drawInRect:badgeRect fromRect:rectFromSize([countImage size]) operation:NSCompositeSourceOver fraction:1.0];
NSString *numString = [NSString stringWithFormat:@"%ld", (long)count];
NSRect textRect = NSInsetRect(badgeRect, NSHeight(badgeRect) /4, NSHeight(badgeRect)/4);
NSDictionary *numAttributes = [numString attributesToFitNumbersInRect:textRect withAttributes:countBadgeTextAttributes];
// NSLog(@"font metric: %f %f", [[numAttributes objectForKey:NSFontAttributeName] ascender] , [[numAttributes objectForKey:NSFontAttributeName] descender]);
NSRect glyphRect = rectFromSize([numString sizeWithAttributes:numAttributes]);
NSRect countTextRect = centerRectInRect(glyphRect, badgeRect);
countTextRect.origin.y += (NSHeight(glyphRect) -[[numAttributes objectForKey:NSFontAttributeName] ascender])/2;

// [[NSColor blackColor] set];
// NSFrameRect(countTextRect);
[numString drawInRect:countTextRect withAttributes:numAttributes];
}

@implementation QSObjectCell


Expand Down Expand Up @@ -585,11 +552,10 @@ - (void)drawObjectImage:(QSObject *)drawObject inRect:(NSRect)drawingRect cellFr
[cornerBadge drawInRect:badgeRect fromRect:rectFromSize([cornerBadge size]) operation:NSCompositeSourceOver fraction:1.0 respectFlipped:flipped hints:nil];
}

if ([drawObject primaryCount] >1 && MIN(NSWidth(drawingRect), NSHeight(drawingRect) ) >= 64) {
NSImage *countImage = [QSCountBadgeImage badgeForCount:[drawObject primaryCount]];
//NSImage *countImage = QSBadgeImageForCount([drawObject primaryCount]);
if ([drawObject primaryCount] > 1 && MIN(NSWidth(drawingRect), NSHeight(drawingRect) ) >= 64) {
QSCountBadgeImage *countImage = [QSCountBadgeImage badgeForCount:[drawObject primaryCount]];
if (countImage) {
NSRect badgeRect = [self badgeRectForBounds:cellFrame badgeImage:countImage];
NSRect badgeRect = [self badgeRectForBounds:drawingRect badgeImage:countImage];
[countImage drawInRect:badgeRect fromRect:rectFromSize([countImage size]) operation:NSCompositeSourceOver fraction:1.0 respectFlipped:flipped hints:nil];
}
}
Expand Down
24 changes: 24 additions & 0 deletions Quicksilver/Quicksilver.xcodeproj/project.pbxproj
Expand Up @@ -364,6 +364,10 @@
CDCC201010A4C14B009C4EED /* QSMDPredicate.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCC200E10A4C14B009C4EED /* QSMDPredicate.h */; settings = {ATTRIBUTES = (Public, ); }; };
CDCC201110A4C14B009C4EED /* QSMDPredicate.m in Sources */ = {isa = PBXBuildFile; fileRef = CDCC200F10A4C14B009C4EED /* QSMDPredicate.m */; };
CDD30969160AEB0800CD34EC /* QSAction.name.strings in Resources */ = {isa = PBXBuildFile; fileRef = 423DA024132F7A2C005ED70F /* QSAction.name.strings */; };
CDD3096E160B860A00CD34EC /* countBadge1&2.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CDD3096A160B860A00CD34EC /* countBadge1&2.tiff */; };
CDD3096F160B860A00CD34EC /* countBadge3.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CDD3096B160B860A00CD34EC /* countBadge3.tiff */; };
CDD30970160B860A00CD34EC /* countBadge4.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CDD3096C160B860A00CD34EC /* countBadge4.tiff */; };
CDD30971160B860A00CD34EC /* countBadge5.tiff in Resources */ = {isa = PBXBuildFile; fileRef = CDD3096D160B860A00CD34EC /* countBadge5.tiff */; };
CDD36AF414CD50CC00F5CEC4 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F8D135E09187AE20062C966 /* Quartz.framework */; };
CDD36AF514CD50CD00F5CEC4 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F8D135E09187AE20062C966 /* Quartz.framework */; };
CDDB44E41518C53300800B66 /* QSCrashReporter.xib in Resources */ = {isa = PBXBuildFile; fileRef = CDDB44E31518C53300800B66 /* QSCrashReporter.xib */; };
Expand Down Expand Up @@ -1397,6 +1401,10 @@
CDC9C6C413DA2B6D0053B09C /* Clipboard.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Clipboard.icns; sourceTree = "<group>"; };
CDCC200E10A4C14B009C4EED /* QSMDPredicate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QSMDPredicate.h; sourceTree = "<group>"; };
CDCC200F10A4C14B009C4EED /* QSMDPredicate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QSMDPredicate.m; sourceTree = "<group>"; };
CDD3096A160B860A00CD34EC /* countBadge1&2.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "countBadge1&2.tiff"; sourceTree = "<group>"; };
CDD3096B160B860A00CD34EC /* countBadge3.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = countBadge3.tiff; sourceTree = "<group>"; };
CDD3096C160B860A00CD34EC /* countBadge4.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = countBadge4.tiff; sourceTree = "<group>"; };
CDD3096D160B860A00CD34EC /* countBadge5.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = countBadge5.tiff; sourceTree = "<group>"; };
CDDB44E31518C53300800B66 /* QSCrashReporter.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = QSCrashReporter.xib; sourceTree = "<group>"; };
CDDB44E51518C78F00800B66 /* QSCrashReporterWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QSCrashReporterWindowController.h; sourceTree = "<group>"; };
CDDB44E61518C78F00800B66 /* QSCrashReporterWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QSCrashReporterWindowController.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2202,6 +2210,17 @@
path = QSDroplet;
sourceTree = "<group>";
};
CDD30972160B860C00CD34EC /* Count Badges */ = {
isa = PBXGroup;
children = (
CDD3096A160B860A00CD34EC /* countBadge1&2.tiff */,
CDD3096B160B860A00CD34EC /* countBadge3.tiff */,
CDD3096C160B860A00CD34EC /* countBadge4.tiff */,
CDD3096D160B860A00CD34EC /* countBadge5.tiff */,
);
name = "Count Badges";
sourceTree = "<group>";
};
CDE1E65F158A4CFD00355A9F /* VDKQueue */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2299,6 +2318,7 @@
E103EC8506471DBF00447FE0 /* Images */ = {
isa = PBXGroup;
children = (
CDD30972160B860C00CD34EC /* Count Badges */,
CDA9D3DD1549D13B00607BE4 /* AlertCautionIcon.icns */,
7F46BFDC0A87F37F002D31E8 /* prefsGeneral.png */,
7F4ADB5E0A4EB766002A2A1B /* BackArrow.png */,
Expand Down Expand Up @@ -3730,6 +3750,10 @@
4D62E31C1476919300362E9A /* QSTriggersPrefPane.strings in Resources */,
CDDB44E41518C53300800B66 /* QSCrashReporter.xib in Resources */,
CDA9D3DE1549D13B00607BE4 /* AlertCautionIcon.icns in Resources */,
CDD3096E160B860A00CD34EC /* countBadge1&2.tiff in Resources */,
CDD3096F160B860A00CD34EC /* countBadge3.tiff in Resources */,
CDD30970160B860A00CD34EC /* countBadge4.tiff in Resources */,
CDD30971160B860A00CD34EC /* countBadge5.tiff in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file modified Quicksilver/Resources/Images/AppearanceBack.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/AppearanceSelection.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/AppearanceText.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/BackArrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/Button-Add.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/Button-AddMenu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/Button-GearMenu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/Button-Info.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/Button-Remove.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/Button-Rescan.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/ContactEmail.icns
Binary file not shown.
Binary file modified Quicksilver/Resources/Images/DefaultBookmarkIcon.icns
Binary file not shown.
Binary file modified Quicksilver/Resources/Images/Find.icns
Binary file not shown.
Binary file modified Quicksilver/Resources/Images/ForwardArrow.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/KeyboardTrigger.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/Pref-PlugIns.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/Pref-Settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/QSPlugIn.icns
Binary file not shown.
Binary file modified Quicksilver/Resources/Images/QuicksilverMenu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/QuicksilverMenuLight.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Quicksilver/Resources/Images/QuicksilverMenuPressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Quicksilver/Resources/Images/countBadge1&2.tiff
Binary file not shown.
Binary file added Quicksilver/Resources/Images/countBadge3.tiff
Binary file not shown.
Binary file added Quicksilver/Resources/Images/countBadge4.tiff
Binary file not shown.
Binary file added Quicksilver/Resources/Images/countBadge5.tiff
Binary file not shown.
Binary file modified Quicksilver/Resources/Images/defaultAction.icns
Binary file not shown.
Binary file modified Quicksilver/Resources/Images/prefsGeneral.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 2 additions & 10 deletions Quicksilver/Resources/ResourceLocations.plist
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AFPClient</key>
Expand Down Expand Up @@ -28,7 +28,7 @@
<array>
<dict>
<key>type</key>
<string>'osas'</string>
<string>&apos;osas&apos;</string>
</dict>
</array>
<key>Computer</key>
Expand Down Expand Up @@ -93,14 +93,6 @@
</array>
<key>commandIcon</key>
<string>ForwardArrowIcon</string>
<key>countBadge1&amp;2</key>
<string>/Applications/Mail.app/Contents/Resources/newMailBadge1&amp;2.tiff</string>
<key>countBadge3</key>
<string>/Applications/Mail.app/Contents/Resources/newMailBadge3.tiff</string>
<key>countBadge4</key>
<string>/Applications/Mail.app/Contents/Resources/newMailBadge4.tiff</string>
<key>countBadge5</key>
<string>/Applications/Mail.app/Contents/Resources/newMailBadge5.tiff</string>
<key>extrasIcon</key>
<string>AlertNoteIcon</string>
<key>genericPerson</key>
Expand Down