Revision: 18119
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18119&view=rev
Author: hofman
Date: 2011-09-10 12:11:00 +0000 (Sat, 10 Sep 2011)
Log Message:
-----------
use textfieldcell for drawing background of fontwell, so we get a consistent
look also on Lion
Modified Paths:
--------------
trunk/bibdesk/BDSKFontWell.h
trunk/bibdesk/BDSKFontWell.m
Modified: trunk/bibdesk/BDSKFontWell.h
===================================================================
--- trunk/bibdesk/BDSKFontWell.h 2011-09-10 06:39:20 UTC (rev 18118)
+++ trunk/bibdesk/BDSKFontWell.h 2011-09-10 12:11:00 UTC (rev 18119)
@@ -60,5 +60,7 @@
@end
-@interface BDSKFontWellCell : NSButtonCell
+@interface BDSKFontWellCell : NSButtonCell {
+ NSTextFieldCell *bgCell;
+}
@end
Modified: trunk/bibdesk/BDSKFontWell.m
===================================================================
--- trunk/bibdesk/BDSKFontWell.m 2011-09-10 06:39:20 UTC (rev 18118)
+++ trunk/bibdesk/BDSKFontWell.m 2011-09-10 12:11:00 UTC (rev 18119)
@@ -305,6 +305,8 @@
@implementation BDSKFontWellCell
- (void)commonInit {
+ bgCell = [[NSTextFieldCell alloc] initTextCell:@""];
+ [bgCell setBezeled:YES];
[self setBezelStyle:NSShadowlessSquareBezelStyle]; // this is mainly to
make it selectable
[self setButtonType:NSPushOnPushOffButton];
[self setState:NSOffState];
@@ -326,29 +328,23 @@
return self;
}
+- (void)dealloc {
+ BDSKDESTROY(bgCell);
+ [super dealloc];
+}
+
- (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView {
- [NSGraphicsContext saveGraphicsState];
+ [bgCell drawWithFrame:frame inView:controlView];
- NSColor *bgColor = [self state] == NSOnState ? [NSColor
selectedControlColor] : [NSColor controlBackgroundColor];
- NSColor *edgeColor = [NSColor colorWithCalibratedWhite:0 alpha:[self
isHighlighted] ? 0.33 : .11];
-
- [bgColor setFill];
- NSRectFill(frame);
-
- [edgeColor setStroke];
- [[NSBezierPath bezierPathWithRect:NSInsetRect(frame, 0.5, 0.5)] stroke];
-
- NSBezierPath *path = [NSBezierPath bezierPathWithRect:frame];
- [path appendBezierPathWithRect:NSInsetRect(frame, -2.0, -2.0)];
- [path setWindingRule:NSEvenOddWindingRule];
- NSShadow *shadow1 = [[NSShadow new] autorelease];
- [shadow1 setShadowBlurRadius:2.0];
- [shadow1 setShadowOffset:NSMakeSize(0.0, -1.0)];
- [shadow1 setShadowColor:[NSColor colorWithCalibratedWhite:0.0 alpha:0.7]];
- [shadow1 set];
- [[NSColor blackColor] setFill];
- [path fill];
-
+ [NSGraphicsContext saveGraphicsState];
+ if ([self state] == NSOnState) {
+ [[NSColor selectedControlColor] setFill];
+ NSRectFillUsingOperation(frame, NSCompositePlusDarker);
+ }
+ if ([self isHighlighted]) {
+ [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] setFill];
+ NSFrameRectWithWidthUsingOperation(frame, 1.0, NSCompositePlusDarker);
+ }
[NSGraphicsContext restoreGraphicsState];
if ([self refusesFirstResponder] == NO && [NSApp isActive] &&
[[controlView window] isKeyWindow] && [[controlView window] firstResponder] ==
controlView) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Malware Security Report: Protecting Your Business, Customers, and the
Bottom Line. Protect your business and customers by understanding the
threat from malware and how it can impact your online business.
http://www.accelacomm.com/jaw/sfnl/114/51427462/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit