Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a custom NSActionTemplate image derived from the Cocotron project…
…, with thanks to Math Campbell (www.mathcampbell.co.uk), for pre 10.5 systems.
  • Loading branch information
mbaltaks committed May 27, 2009
1 parent 909dbed commit 0e28fe1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ClickToFlash.xcodeproj/project.pbxproj
Expand Up @@ -36,6 +36,7 @@
/* Begin PBXBuildFile section */
0038DE240FC0CCF0007B54E9 /* MATrackingArea.m in Sources */ = {isa = PBXBuildFile; fileRef = 0038DE230FC0CCF0007B54E9 /* MATrackingArea.m */; };
0038DE320FC0CE7B007B54E9 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0038DE310FC0CE7B007B54E9 /* Carbon.framework */; };
00FBE92F0FCD68CE00BC0995 /* NSActionTemplate.png in Resources */ = {isa = PBXBuildFile; fileRef = 00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */; };
072189BE0F30D9C3008C8944 /* ContextualMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 072189BA0F30D9C3008C8944 /* ContextualMenu.xib */; };
072189BF0F30D9C3008C8944 /* WhitelistPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 072189BC0F30D9C3008C8944 /* WhitelistPanel.xib */; };
55EB70480E04A8850016593D /* Plugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 55EB703D0E04A84F0016593D /* Plugin.m */; };
Expand Down Expand Up @@ -129,6 +130,7 @@
0038DE220FC0CCF0007B54E9 /* MATrackingArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MATrackingArea.h; sourceTree = "<group>"; };
0038DE230FC0CCF0007B54E9 /* MATrackingArea.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MATrackingArea.m; sourceTree = "<group>"; };
0038DE310FC0CE7B007B54E9 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NSActionTemplate.png; sourceTree = "<group>"; };
072189BB0F30D9C3008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/ContextualMenu.xib; sourceTree = "<group>"; };
072189BD0F30D9C3008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/WhitelistPanel.xib; sourceTree = "<group>"; };
55EB703C0E04A84F0016593D /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = Plugin/Plugin.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -239,6 +241,7 @@
072189BC0F30D9C3008C8944 /* WhitelistPanel.xib */,
D9FFA7650F3941C1008A8708 /* ClickToFlash_Prefix.pch */,
A494CC2B0F9F2446007D5EEB /* ctf.icns */,
00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */,
D9566C2B0F37EA0800358646 /* deSIFR Resources */,
79E2EB910F86AAD3005CF170 /* SparkleManager.h */,
79E2EB920F86AAD3005CF170 /* SparkleManager.m */,
Expand Down Expand Up @@ -397,6 +400,7 @@
072189BF0F30D9C3008C8944 /* WhitelistPanel.xib in Resources */,
6953E43C0F3EDEB50014ECF7 /* MenubarMenu.xib in Resources */,
A494CC2C0F9F2446007D5EEB /* ctf.icns in Resources */,
00FBE92F0FCD68CE00BC0995 /* NSActionTemplate.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file added NSActionTemplate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Plugin/Plugin.m
Expand Up @@ -690,6 +690,12 @@ - (void) _drawGearIcon

float margin = 5.0;
NSImage *gearImage = [NSImage imageNamed:@"NSActionTemplate"];
// On systems older than 10.5 we need to supply our own image.
if (gearImage == nil)
{
NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"NSActionTemplate" ofType:@"png"];
gearImage = [[[NSImage alloc] initWithContentsOfFile:path] autorelease];
}

if( gearImage ) {
CGContextRef context = [ [ NSGraphicsContext currentContext ] graphicsPort ];
Expand Down

0 comments on commit 0e28fe1

Please sign in to comment.