Revision: 5337
http://skim-app.svn.sourceforge.net/skim-app/?rev=5337&view=rev
Author: hofman
Date: 2009-04-28 13:06:21 +0000 (Tue, 28 Apr 2009)
Log Message:
-----------
Override highlight color in thumbnail and toc tables in the tableview classes
and don't change the highlight color of the text field cell. NSTextFieldCell on
Tiger needs the highlight color to decide about the text color, which is lame.
Modified Paths:
--------------
trunk/SKThumbnailTableView.m
trunk/SKTocOutlineView.m
trunk/Skim.xcodeproj/project.pbxproj
Removed Paths:
-------------
trunk/NSTextFieldCell_SKExtensions.h
trunk/NSTextFieldCell_SKExtensions.m
Deleted: trunk/NSTextFieldCell_SKExtensions.h
===================================================================
--- trunk/NSTextFieldCell_SKExtensions.h 2009-04-28 11:46:13 UTC (rev
5336)
+++ trunk/NSTextFieldCell_SKExtensions.h 2009-04-28 13:06:21 UTC (rev
5337)
@@ -1,45 +0,0 @@
-//
-// 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-2009
- 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>
-
-
-...@interface NSTextFieldCell (SKExtensions)
-...@end
Deleted: trunk/NSTextFieldCell_SKExtensions.m
===================================================================
--- trunk/NSTextFieldCell_SKExtensions.m 2009-04-28 11:46:13 UTC (rev
5336)
+++ trunk/NSTextFieldCell_SKExtensions.m 2009-04-28 13:06:21 UTC (rev
5337)
@@ -1,51 +0,0 @@
-//
-// 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-2009
- 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"
-
-
-...@implementation 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;
-}
-
-...@end
Modified: trunk/SKThumbnailTableView.m
===================================================================
--- trunk/SKThumbnailTableView.m 2009-04-28 11:46:13 UTC (rev 5336)
+++ trunk/SKThumbnailTableView.m 2009-04-28 13:06:21 UTC (rev 5337)
@@ -64,6 +64,10 @@
@end
+...@interface NSTableView (SKApplePrivate)
+- (id)_highlightColorForCell:(NSCell *)cell;
+...@end
+
@implementation SKThumbnailTableView
#define TIGER_BACKGROUNDCOLOR [NSColor colorWithCalibratedRed:0.905882
green:0.929412 blue:0.964706 alpha:1.0]
@@ -93,6 +97,16 @@
[super dealloc];
}
+// Tiger draws the highlight color in the cell, which I think is wrong, but it
also uses the highlight color to decide about the text color, which is even
more wrong
+- (id)_highlightColorForCell:(NSCell *)cell {
+ if ([self respondsToSelector:@selector(setSelectionHighlightStyle:)])
+ return [super _highlightColorForCell:cell];
+ else if ([[self window] isKeyWindow] && [[self window] firstResponder] ==
self)
+ return [super _highlightColorForCell:cell];
+ else
+ return nil;
+}
+
static CGFloat keyColorBlue[3] = {14135.0/65535.0, 29298.0/65535.0,
48830.0/65535.0};
static CGFloat mainColorBlue[3] = {34695.0/65535.0, 39064.0/65535.0,
48316.0/65535.0};
static CGFloat disabledColorBlue[3] = {40606.0/65535.0, 40606.0/65535.0,
40606.0/65535.0};
Modified: trunk/SKTocOutlineView.m
===================================================================
--- trunk/SKTocOutlineView.m 2009-04-28 11:46:13 UTC (rev 5336)
+++ trunk/SKTocOutlineView.m 2009-04-28 13:06:21 UTC (rev 5337)
@@ -41,6 +41,10 @@
#import "NSColor_SKExtensions.h"
+...@interface NSOutlineView (SKApplePrivate)
+- (id)_highlightColorForCell:(NSCell *)cell;
+...@end
+
@implementation SKTocOutlineView
+ (BOOL)usesDefaultFontSize { return YES; }
@@ -73,6 +77,16 @@
[super dealloc];
}
+// Tiger draws the highlight color in the cell, which I think is wrong, but it
also uses the highlight color to decide about the text color, which is even
more wrong
+- (id)_highlightColorForCell:(NSCell *)cell {
+ if ([self respondsToSelector:@selector(setSelectionHighlightStyle:)])
+ return [super _highlightColorForCell:cell];
+ else if ([[self window] isKeyWindow] && [[self window] firstResponder] ==
self)
+ return [super _highlightColorForCell:cell];
+ else
+ return nil;
+}
+
static CGFloat keyColorBlue[3] = {14135.0/65535.0, 29298.0/65535.0,
48830.0/65535.0};
static CGFloat mainColorBlue[3] = {34695.0/65535.0, 39064.0/65535.0,
48316.0/65535.0};
static CGFloat disabledColorBlue[3] = {40606.0/65535.0, 40606.0/65535.0,
40606.0/65535.0};
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2009-04-28 11:46:13 UTC (rev
5336)
+++ trunk/Skim.xcodeproj/project.pbxproj 2009-04-28 13:06:21 UTC (rev
5337)
@@ -132,7 +132,6 @@
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 /* 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 */; };
@@ -691,8 +690,6 @@
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 /* 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>"; };
@@ -1649,8 +1646,6 @@
CE070EA10B89039700733CC8 /*
NSScrollView_SKExtensions.m */,
CEE54F6E0DA3FBE00037169F /*
NSSegmentedControl_SKExtensions.h */,
CEE54F6F0DA3FBE00037169F /*
NSSegmentedControl_SKExtensions.m */,
- CE5F71530C8CDF9A008BE480 /*
NSTextFieldCell_SKExtensions.h */,
- CE5F71540C8CDF9A008BE480 /*
NSTextFieldCell_SKExtensions.m */,
CEF7119F0B90B714003A2771 /*
NSUserDefaultsController_SKExtensions.h */,
CEF711A00B90B714003A2771 /*
NSUserDefaultsController_SKExtensions.m */,
CE20B1920C9F23CC007C72F9 /*
NSView_SKExtensions.h */,
@@ -2145,7 +2140,6 @@
CE5BF8010C7CBF6300EBDCF7 /* SKTableView.m in
Sources */,
CE5BF8430C7CC24A00EBDCF7 /* SKOutlineView.m in
Sources */,
CE820A220C8A0E310020E6B0 /*
NSTask_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.
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit