From 0e28fe15bd93b3adcb9ef86c00a21e14b5e48b79 Mon Sep 17 00:00:00 2001 From: Michael Baltaks Date: Wed, 27 May 2009 22:58:10 +1000 Subject: [PATCH] Add a custom NSActionTemplate image derived from the Cocotron project, with thanks to Math Campbell (www.mathcampbell.co.uk), for pre 10.5 systems. --- ClickToFlash.xcodeproj/project.pbxproj | 4 ++++ NSActionTemplate.png | Bin 0 -> 3802 bytes Plugin/Plugin.m | 6 ++++++ 3 files changed, 10 insertions(+) create mode 100644 NSActionTemplate.png diff --git a/ClickToFlash.xcodeproj/project.pbxproj b/ClickToFlash.xcodeproj/project.pbxproj index d40fa754..298c3776 100755 --- a/ClickToFlash.xcodeproj/project.pbxproj +++ b/ClickToFlash.xcodeproj/project.pbxproj @@ -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 */; }; @@ -129,6 +130,7 @@ 0038DE220FC0CCF0007B54E9 /* MATrackingArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MATrackingArea.h; sourceTree = ""; }; 0038DE230FC0CCF0007B54E9 /* MATrackingArea.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MATrackingArea.m; sourceTree = ""; }; 0038DE310FC0CE7B007B54E9 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 00FBE92E0FCD68CE00BC0995 /* NSActionTemplate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = NSActionTemplate.png; sourceTree = ""; }; 072189BB0F30D9C3008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/ContextualMenu.xib; sourceTree = ""; }; 072189BD0F30D9C3008C8944 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Plugin/English.lproj/WhitelistPanel.xib; sourceTree = ""; }; 55EB703C0E04A84F0016593D /* Plugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plugin.h; path = Plugin/Plugin.h; sourceTree = ""; }; @@ -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 */, @@ -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; }; diff --git a/NSActionTemplate.png b/NSActionTemplate.png new file mode 100644 index 0000000000000000000000000000000000000000..3e8071f51f0d1c15a7c98745e853a0e233475593 GIT binary patch literal 3802 zcmeHKZ)h837|&)mx{T6}>9$r%kE>%HF1h@z&Gpg}n{LfqYE3c{R+(Pz-X=#bch|eO zOTI1`H#Zp-x1xfI{V*9rLBv9pjnR$P4_kfjE=dz?gn;{& zKyrESd49j=d4BKnKJXss>E2OgtTP%6hALl|H-Mfs>bG(=`fZq7q|u`mc1B=O?1L#< z1_lo+Mgita(lHPKG&|J)4WJO1;zAJ^@$VuTF=?h%A9Fe>A+*6jwWlSTNdSmNL5vgJ z_{|HKaExQ!c-ZN;_@xdI=emYv5FG9fF~bSQ#p3O4Mk-Arf+T=6mQM15LZ;og#!I6A z>T3eWG#8j~<9bpNe-G9n$^dhiZDyN^u{7H;r`>FK+L~>SZJ5nsX(23+5q68o+Co~K zq{E73K6slEqhz*^40yL^!l9KLk3%St1d&Rm%qhEBlw*X|<#G`g8)37VkcUYb5+I#6 z2}+|%p>ueF!pNKiIZ?n=PC6J!_nhp|CF~H<8DOAK=o7UTFZAI&tlXJ~G%IJ1z`yMs92_cc4WOx^^+pl)9!6wQ zi|Wn03^|mGk%s^u7G*R)mc@1^Y3{%5yXCA^lTqKiyu*)nLw|>c3Yup`ZlLMglo>tu z?V+i4-`F$6SM_H!lP zRJUrp=AnllZCy9|b$cXUQ}M&iuS7ax9$VXRqfZoU6Bm3V_fEc4eUUl+Oknc*>vYw} zza2a@J3I4qw{x50K#*;jsyzE(YyF%3qYEnsdf(+nPP9^QFVs$WzJJ-&Gfl*fnyvLO zT&cO?|7pwM_{qz+=c=3je(PX7flu!_cWXbm-t^AYd!+x)k?$7e>gQahW@V6fZuvC) zqrYWu%} zb@%Xz@x%sd9y>p`n24qpH~juNzi(^(lP`AtF%}z{x4ve-96q+Domu(khi8s#9sA^b k$aUwDsQ2!P#Z{XO>t~)HJpD_fSG{feI=j869)EWKKfTFJY5)KL literal 0 HcmV?d00001 diff --git a/Plugin/Plugin.m b/Plugin/Plugin.m index 639579b3..8b3cbc79 100755 --- a/Plugin/Plugin.m +++ b/Plugin/Plugin.m @@ -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 ];