Revision: 5065
http://skim-app.svn.sourceforge.net/skim-app/?rev=5065&view=rev
Author: hofman
Date: 2008-12-16 12:13:07 +0000 (Tue, 16 Dec 2008)
Log Message:
-----------
use a simple view for navigation window separator
Modified Paths:
--------------
trunk/SKNavigationWindow.h
trunk/SKNavigationWindow.m
Modified: trunk/SKNavigationWindow.h
===================================================================
--- trunk/SKNavigationWindow.h 2008-12-15 18:54:58 UTC (rev 5064)
+++ trunk/SKNavigationWindow.h 2008-12-16 12:13:07 UTC (rev 5065)
@@ -107,3 +107,7 @@
- (void)setAlternatePath:(NSBezierPath *)newAlternatePath;
@end
+
+
+...@interface SKNavigationSeparator : NSView
+...@end
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2008-12-15 18:54:58 UTC (rev 5064)
+++ trunk/SKNavigationWindow.m 2008-12-16 12:13:07 UTC (rev 5065)
@@ -95,9 +95,7 @@
rect.origin.x = NSMaxX(rect);
rect.size.width = SEP_WIDTH;
- button = [[[SKNavigationButton alloc] initWithFrame:rect] autorelease];
- [button setPath:separatorButtonPath(rect.size)];
- [button setEnabled:NO];
+ button = [[[SKNavigationSeparator alloc] initWithFrame:rect]
autorelease];
[[self contentView] addSubview:button];
rect.origin.x = NSMaxX(rect);
@@ -118,9 +116,7 @@
rect.origin.x = NSMaxX(rect);
rect.size.width = SEP_WIDTH;
- button = [[[SKNavigationButton alloc] initWithFrame:rect] autorelease];
- [button setPath:separatorButtonPath(rect.size)];
- [button setEnabled:NO];
+ button = [[[SKNavigationSeparator alloc] initWithFrame:rect]
autorelease];
[[self contentView] addSubview:button];
rect.origin.x = NSMaxX(rect);
@@ -431,7 +427,7 @@
}
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
- [[NSColor colorWithCalibratedWhite:1.0 alpha:[self isHighlighted] ? 0.9 :
0.6] set];
+ [[NSColor colorWithCalibratedWhite:1.0 alpha:[self isHighlighted] ? 0.9 :
0.6] setFill];
[([self state] == NSOnState && [self alternatePath] ? [self alternatePath]
: [self path]) fill];
}
@@ -463,6 +459,18 @@
@end
+#pragma mark -
+
+...@implementation SKNavigationSeparator
+
+- (void)drawRect:(NSRect)rect {
+ NSRect bounds = [self bounds];
+ [[NSColor colorWithCalibratedWhite:1.0 alpha:0.6] setFill];
+ [NSBezierPath fillRect:NSMakeRect(NSMidX(bounds) - 0.5, NSMinY(bounds),
1.0, NSHeight(bounds))];
+}
+
+...@end
+
#pragma mark Button paths
static inline NSBezierPath *nextButtonPath(NSSize size) {
@@ -585,9 +593,3 @@
return path;
}
-
-static inline NSBezierPath *separatorButtonPath(NSSize size) {
- NSRect bounds = {NSZeroPoint, size};
- NSBezierPath *path = [NSBezierPath
bezierPathWithRect:NSMakeRect(NSMidX(bounds) - 0.5, NSMinY(bounds), 1.0,
NSHeight(bounds))];
- return path;
-}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit