Revision: 4841
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4841&view=rev
Author:   hofman
Date:     2008-10-21 10:05:40 +0000 (Tue, 21 Oct 2008)

Log Message:
-----------
Fix background drawing in highlighted cells in NSTextFieldCell rather than 
NSCell. Just draw no background color when drawsBackground returns NO.

Modified Paths:
--------------
    trunk/Skim.xcodeproj/project.pbxproj

Added Paths:
-----------
    trunk/NSTextFieldCell_SKExtensions.h
    trunk/NSTextFieldCell_SKExtensions.m

Removed Paths:
-------------
    trunk/NSCell_SKExtensions.h
    trunk/NSCell_SKExtensions.m

Deleted: trunk/NSCell_SKExtensions.h
===================================================================
--- trunk/NSCell_SKExtensions.h 2008-10-21 09:37:36 UTC (rev 4840)
+++ trunk/NSCell_SKExtensions.h 2008-10-21 10:05:40 UTC (rev 4841)
@@ -1,45 +0,0 @@
-//
-//  NSCell_SKExtensions.h
-//  Skim
-//
-//  Created by Christiaan Hofman on 9/4/07.
-//  Copyright 2007 Christiaan Hofman. All rights reserved.
-//
-/*
- This software is Copyright (c) 2007-2008
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Cocoa/Cocoa.h>
-
-
[EMAIL PROTECTED] NSCell (SKExtensions)
[EMAIL PROTECTED]

Deleted: trunk/NSCell_SKExtensions.m
===================================================================
--- trunk/NSCell_SKExtensions.m 2008-10-21 09:37:36 UTC (rev 4840)
+++ trunk/NSCell_SKExtensions.m 2008-10-21 10:05:40 UTC (rev 4841)
@@ -1,60 +0,0 @@
-//
-//  NSCell_SKExtensions.h
-//  Skim
-//
-//  Created by Christiaan Hofman on 9/4/07.
-//  Copyright 2007 Christiaan Hofman. All rights reserved.
-//
-/*
- This software is Copyright (c) 2007-2008
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "NSCell_SKExtensions.h"
-#import "SKRuntime.h"
-
-
[EMAIL PROTECTED] NSCell (SKExtensions)
-
-static id (*originalHighlightColorWithFrameInView)(id, SEL, NSRect, id) = NULL;
-
-- (NSColor *)replacementHighlightColorWithFrame:(NSRect)cellFrame 
inView:(NSView *)controlView {
-    if ([controlView respondsToSelector:@selector(highlightColor)])
-        return [(id)controlView highlightColor];
-    else
-        return originalHighlightColorWithFrameInView(self, _cmd, cellFrame, 
controlView);
-}
-
-+ (void)load {
-    originalHighlightColorWithFrameInView = (id (*)(id, SEL, NSRect, 
id))SKReplaceInstanceMethodImplementationFromSelector(self, 
@selector(highlightColorWithFrame:inView:), 
@selector(replacementHighlightColorWithFrame:inView:));
-}
-
[EMAIL PROTECTED]

Copied: trunk/NSTextFieldCell_SKExtensions.h (from rev 4832, 
trunk/NSCell_SKExtensions.h)
===================================================================
--- trunk/NSTextFieldCell_SKExtensions.h                                (rev 0)
+++ trunk/NSTextFieldCell_SKExtensions.h        2008-10-21 10:05:40 UTC (rev 
4841)
@@ -0,0 +1,45 @@
+//
+//  NSTextFieldCell_SKExtensions.h
+//  Skim
+//
+//  Created by Christiaan Hofman on 9/4/07.
+//  Copyright 2007 Christiaan Hofman. All rights reserved.
+//
+/*
+ This software is Copyright (c) 2007-2008
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+
[EMAIL PROTECTED] NSTextFieldCell (SKExtensions)
[EMAIL PROTECTED]

Copied: trunk/NSTextFieldCell_SKExtensions.m (from rev 4832, 
trunk/NSCell_SKExtensions.m)
===================================================================
--- trunk/NSTextFieldCell_SKExtensions.m                                (rev 0)
+++ trunk/NSTextFieldCell_SKExtensions.m        2008-10-21 10:05:40 UTC (rev 
4841)
@@ -0,0 +1,51 @@
+//
+//  NSTextFieldCell_SKExtensions.h
+//  Skim
+//
+//  Created by Christiaan Hofman on 9/4/07.
+//  Copyright 2007 Christiaan Hofman. All rights reserved.
+//
+/*
+ This software is Copyright (c) 2007-2008
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "NSTextFieldCell_SKExtensions.h"
+
+
[EMAIL PROTECTED] NSTextFieldCell (SKExtensions)
+
+// Fix an AppKit bug, so text cells don't draw their background in selected 
table rows when they're not supposed to
+- (NSColor *)highlightColorWithFrame:(NSRect)cellFrame inView:(NSView 
*)controlView {
+    return [self drawsBackground] ? [super highlightColorWithFrame:cellFrame 
inView:controlView] : nil;
+}
+
[EMAIL PROTECTED]

Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj        2008-10-21 09:37:36 UTC (rev 
4840)
+++ trunk/Skim.xcodeproj/project.pbxproj        2008-10-21 10:05:40 UTC (rev 
4841)
@@ -130,7 +130,7 @@
                CE5BF8010C7CBF6300EBDCF7 /* SKTableView.m in Sources */ = {isa 
= PBXBuildFile; fileRef = CE5BF7FF0C7CBF6300EBDCF7 /* SKTableView.m */; };
                CE5BF8430C7CC24A00EBDCF7 /* SKOutlineView.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CE5BF8410C7CC24A00EBDCF7 /* SKOutlineView.m */; 
};
                CE5F43730BF8A3410069D89C /* IOKit.framework in Frameworks */ = 
{isa = PBXBuildFile; fileRef = CE5F42D30BF8A3400069D89C /* IOKit.framework */; 
};
-               CE5F71560C8CDF9A008BE480 /* NSCell_SKExtensions.m in Sources */ 
= {isa = PBXBuildFile; fileRef = CE5F71540C8CDF9A008BE480 /* 
NSCell_SKExtensions.m */; };
+               CE5F71560C8CDF9A008BE480 /* NSTextFieldCell_SKExtensions.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CE5F71540C8CDF9A008BE480 /* 
NSTextFieldCell_SKExtensions.m */; };
                CE5FA1680C909886008BE480 /* SKFDFParser.m in Sources */ = {isa 
= PBXBuildFile; fileRef = CE5FA1660C909886008BE480 /* SKFDFParser.m */; };
                CE64E8A30D92E670000AD050 /* SKCFCallBacks.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CE64E8A20D92E670000AD050 /* SKCFCallBacks.m */; 
};
                CE665A140E1BF43700D0704D /* SKBookmarkOutlineView.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = CE665A130E1BF43700D0704D /* 
SKBookmarkOutlineView.m */; };
@@ -666,8 +666,8 @@
                CE5BF8400C7CC24A00EBDCF7 /* SKOutlineView.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKOutlineView.h; sourceTree = "<group>"; };
                CE5BF8410C7CC24A00EBDCF7 /* SKOutlineView.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKOutlineView.m; sourceTree = "<group>"; };
                CE5F42D30BF8A3400069D89C /* IOKit.framework */ = {isa = 
PBXFileReference; lastKnownFileType = wrapper.framework; name = 
IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree 
= "<absolute>"; };
-               CE5F71530C8CDF9A008BE480 /* NSCell_SKExtensions.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
NSCell_SKExtensions.h; sourceTree = "<group>"; };
-               CE5F71540C8CDF9A008BE480 /* NSCell_SKExtensions.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= NSCell_SKExtensions.m; sourceTree = "<group>"; };
+               CE5F71530C8CDF9A008BE480 /* NSTextFieldCell_SKExtensions.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = NSTextFieldCell_SKExtensions.h; sourceTree = "<group>"; };
+               CE5F71540C8CDF9A008BE480 /* NSTextFieldCell_SKExtensions.m */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = NSTextFieldCell_SKExtensions.m; sourceTree = 
"<group>"; };
                CE5FA1650C909886008BE480 /* SKFDFParser.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKFDFParser.h; sourceTree = "<group>"; };
                CE5FA1660C909886008BE480 /* SKFDFParser.m */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path 
= SKFDFParser.m; sourceTree = "<group>"; };
                CE64E8A10D92E670000AD050 /* SKCFCallBacks.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
SKCFCallBacks.h; sourceTree = "<group>"; };
@@ -1553,8 +1553,8 @@
                                CE4EC87E0B7E6E110091F228 /* 
NSBezierPath_CoreImageExtensions.m */,
                                F968C5A00C036E9D000BD1B2 /* 
NSBitmapImageRep_SKExtensions.h */,
                                F968C5A10C036E9D000BD1B2 /* 
NSBitmapImageRep_SKExtensions.m */,
-                               CE5F71530C8CDF9A008BE480 /* 
NSCell_SKExtensions.h */,
-                               CE5F71540C8CDF9A008BE480 /* 
NSCell_SKExtensions.m */,
+                               CE5F71530C8CDF9A008BE480 /* 
NSTextFieldCell_SKExtensions.h */,
+                               CE5F71540C8CDF9A008BE480 /* 
NSTextFieldCell_SKExtensions.m */,
                                CE7C204D0C259A5D0059E08C /* 
NSColor_SKExtensions.h */,
                                CE7C204E0C259A5D0059E08C /* 
NSColor_SKExtensions.m */,
                                CE2DE4EC0B85DB6300D0DA12 /* 
NSCursor_SKExtensions.h */,
@@ -2051,7 +2051,7 @@
                                CE5BF8010C7CBF6300EBDCF7 /* SKTableView.m in 
Sources */,
                                CE5BF8430C7CC24A00EBDCF7 /* SKOutlineView.m in 
Sources */,
                                CE820A220C8A0E310020E6B0 /* 
NSTask_SKExtensions.m in Sources */,
-                               CE5F71560C8CDF9A008BE480 /* 
NSCell_SKExtensions.m in Sources */,
+                               CE5F71560C8CDF9A008BE480 /* 
NSTextFieldCell_SKExtensions.m in Sources */,
                                CE5FA1680C909886008BE480 /* SKFDFParser.m in 
Sources */,
                                CEA182280C92E3300061A6D4 /* 
NSData_SKExtensions.m in Sources */,
                                CEA1D6EA0C9984400061A6D4 /* 
SKTextWithIconCell.m in Sources */,


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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to