Revision: 11547
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=11547&view=rev
Author:   amaxwell
Date:     2007-11-11 20:34:44 -0800 (Sun, 11 Nov 2007)

Log Message:
-----------
Restore cell drawing override.

Modified Paths:
--------------
    
branches/TRY_ARM_FILE_INTERFACE/bibdesk_vendorsrc/amaxwell/FileView/FVArrowButton.m

Modified: 
branches/TRY_ARM_FILE_INTERFACE/bibdesk_vendorsrc/amaxwell/FileView/FVArrowButton.m
===================================================================
--- 
branches/TRY_ARM_FILE_INTERFACE/bibdesk_vendorsrc/amaxwell/FileView/FVArrowButton.m
 2007-11-11 19:03:44 UTC (rev 11546)
+++ 
branches/TRY_ARM_FILE_INTERFACE/bibdesk_vendorsrc/amaxwell/FileView/FVArrowButton.m
 2007-11-12 04:34:44 UTC (rev 11547)
@@ -49,6 +49,38 @@
 @end
 
 @implementation FVArrowButtonCell
+
+- (id)init
+{
+    self = [super init];
+    // handle highlight drawing manually, since NSButtonCell draws a 
rectangular background mask
+    [self setHighlightsBy:NSNoCellMask];
+    return self;
+}
+
+- (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView 
*)controlView;
+{
+    // NSCell's highlight drawing does not look correct against a dark 
background, so override it completely
+    
+    if ([self isHighlighted]) {
+        // could check to see if [controlView isFlipped], but the icon is 
symmetric
+        [image drawInRect:frame fromRect:NSZeroRect 
operation:NSCompositeSourceOver fraction:1.0];
+        [[NSColor colorWithCalibratedWhite:0.5 alpha:0.5] setFill];
+        [[NSBezierPath bezierPathWithOvalInRect:frame] fill];
+    }
+    else {
+        [super drawImage:image withFrame:frame inView:controlView];
+        
+        // standard drawing is not a sufficient indicator of disabled state 
for this control
+        if ([self isEnabled] == NO) {
+            [NSGraphicsContext saveGraphicsState];
+            [[NSColor colorWithCalibratedWhite:1.0 alpha:0.5] setFill];
+            [[NSBezierPath bezierPathWithOvalInRect:frame] fill];
+            [NSGraphicsContext restoreGraphicsState];
+        }
+    }
+}
+
 @end
 
 @implementation FVArrowButton


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to