Revision: 18637
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18637&view=rev
Author:   hofman
Date:     2012-05-18 20:49:07 +0000 (Fri, 18 May 2012)
Log Message:
-----------
Workaround for WebKit bug, which sets textfield background color to clear by 
default (rather than white), and when using the 10.5 SDK this becomes black.

Modified Paths:
--------------
    trunk/bibdesk/BDSKWebView.m

Modified: trunk/bibdesk/BDSKWebView.m
===================================================================
--- trunk/bibdesk/BDSKWebView.m 2012-05-18 16:28:56 UTC (rev 18636)
+++ trunk/bibdesk/BDSKWebView.m 2012-05-18 20:49:07 UTC (rev 18637)
@@ -46,6 +46,7 @@
 #import "NSEvent_BDSKExtensions.h"
 #import "NSFileManager_BDSKExtensions.h"
 #import "NSArray_BDSKExtensions.h"
+#import "BDSKRuntime.h"
 
 
 @interface WebView (BDSKSnowLeopardDeclarations)
@@ -510,3 +511,28 @@
 }
 
 @end
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
+
+// WebKit now sets the background color to clearColor by default, which is 
drawn black when using the 10.5 SDK
+
+@interface NSTextFieldCell (BDSKExtensions)
+@end
+
+@implementation NSTextFieldCell (BDSKExtensions)
+
+static void (*original_setBackgroundColor)(id, SEL, id) = NULL;
+
+- (void)replacement_setBackgroundColor:(NSColor *)color {
+    if ([self drawsBackground] && [color isEqual:[NSColor clearColor]])
+        color = [NSColor textBackgroundColor];
+    original_setBackgroundColor(self, _cmd, color);
+}
+
++ (void)load{
+    original_setBackgroundColor = (void (*)(id, SEL, 
id))BDSKReplaceInstanceMethodImplementationFromSelector(self, 
@selector(setBackgroundColor:), @selector(replacement_setBackgroundColor:));
+}
+
+@end
+
+#endif

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to