Revision: 24169
          http://sourceforge.net/p/bibdesk/svn/24169
Author:   hofman
Date:     2019-08-29 15:29:17 +0000 (Thu, 29 Aug 2019)
Log Message:
-----------
draw remove finder label cross in FVFinderLabel class

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderLabel.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m 2019-08-29 
06:30:38 UTC (rev 24168)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVColorMenuView.m 2019-08-29 
15:29:17 UTC (rev 24169)
@@ -310,35 +310,9 @@
             interiorFrame = [controlView centerScanRect:NSInsetRect(frame, 
0.5, 0.5)];
         }
     }
-
-    if (0 == tag) {
-        interiorFrame = NSInsetRect(interiorFrame, 2.0, 2.0);
-        NSBezierPath *p = [NSBezierPath bezierPath];
-        [p moveToPoint:interiorFrame.origin];
-        [p lineToPoint:NSMakePoint(NSMaxX(interiorFrame), 
NSMaxY(interiorFrame))];
-        [p moveToPoint:NSMakePoint(NSMinX(interiorFrame), 
NSMaxY(interiorFrame))];
-        [p lineToPoint:NSMakePoint(NSMaxX(interiorFrame), 
NSMinY(interiorFrame))];
-        [p setLineWidth:2.0];
-        [p setLineCapStyle:NSRoundLineCapStyle];
-        [[NSColor colorWithCalibratedWhite:FVHasDarkAppearance(nil) ? 0.66667 
: 0.33333 alpha:1.0] setStroke];
-        [p stroke];
-    }
-    else {
-        if (isLegacy)
-        {
-            NSShadow *labelShadow = [NSShadow new];
-            [labelShadow setShadowOffset:NSMakeSize(0.0, -1.0)];
-            [labelShadow setShadowBlurRadius:2.0];
-            [labelShadow setShadowColor:[[NSColor controlTextColor] 
colorWithAlphaComponent:0.33333]];
-            [labelShadow set];
-            [FVFinderLabel drawFinderLabel:tag inRect:interiorFrame];
-            [labelShadow release];
-        }
-        else {
-            [FVFinderLabel drawFinderLabel:tag inRect:interiorFrame];
-        }
-    }
     
+    [FVFinderLabel drawFinderLabel:tag inRect:interiorFrame];
+    
     [NSGraphicsContext restoreGraphicsState];
 }
 

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-08-29 
06:30:38 UTC (rev 24168)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-08-29 
15:29:17 UTC (rev 24169)
@@ -3962,23 +3962,9 @@
         [clipPath addClip];
         [FVFinderLabel drawFinderLabel:i inRect:iconRect];
         
-        // Finder displays an unbordered cross for clearing the label, so 
we'll do something similar
-        // @@ Dark mode
-        [[NSColor darkGrayColor] setStroke];
-        if (0 == i) {
-            NSBezierPath *p = [NSBezierPath bezierPath];
-            [p moveToPoint:NSMakePoint(3, 3)];
-            [p lineToPoint:NSMakePoint(9, 9)];
-            [p moveToPoint:NSMakePoint(3, 9)];
-            [p lineToPoint:NSMakePoint(9, 3)];
-            [p setLineWidth:2.0];
-            [p setLineCapStyle:NSRoundLineCapStyle];
-            [p stroke];
-            [p setLineWidth:1.0];
-            [p setLineCapStyle:NSButtLineCapStyle];
-        }
-        else {
+        if (i > 0) {
             // stroke clip path for a subtle border; stroke is wide enough to 
display a thin line inside the clip region
+            [[NSColor darkGrayColor] setStroke];
             [clipPath stroke];
         }
         [image unlockFocus];

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderLabel.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderLabel.m   2019-08-29 
06:30:38 UTC (rev 24168)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderLabel.m   2019-08-29 
15:29:17 UTC (rev 24169)
@@ -436,6 +436,8 @@
         CGContextScaleCTM(context, 1, -1);
         rect.origin.y = 0;
     }
+    if (flag == NO && label != 0)
+        CGContextSetShadow(context, CGSizeMake(0.0, -1.0), 2.0);
     CGContextDrawLayerInRect(context, rect, layerToDraw);
     CGLayerRelease(layerToDraw);
     CGContextRestoreGState(context);
@@ -473,9 +475,25 @@
     [NSGraphicsContext restoreGraphicsState];
 }
 
++ (void)_drawNoFinderLabelInRect:(NSRect)rect;
+{
+    rect = NSInsetRect(rect, 2.0, 2.0);
+    NSBezierPath *p = [NSBezierPath bezierPath];
+    [p moveToPoint:rect.origin];
+    [p lineToPoint:NSMakePoint(NSMaxX(rect), NSMaxY(rect))];
+    [p moveToPoint:NSMakePoint(NSMinX(rect), NSMaxY(rect))];
+    [p lineToPoint:NSMakePoint(NSMaxX(rect), NSMinY(rect))];
+    [p setLineWidth:2.0];
+    [p setLineCapStyle:NSRoundLineCapStyle];
+    [[NSColor colorWithCalibratedWhite:FVHasDarkAppearance(nil) ? 0.66667 : 
0.33333 alpha:1.0] setStroke];
+    [p stroke];
+}
+
 + (void)drawFinderLabel:(NSUInteger)label inRect:(NSRect)rect;
 {
-    if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_10) {
+    if (label == 0) {
+        [self _drawNoFinderLabelInRect:rect];
+    } else if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_10) {
         NSGraphicsContext *nsContext = [NSGraphicsContext currentContext];
         [self _drawFinderLabel:label inRect:NSRectToCGRect(rect) 
ofContext:[nsContext graphicsPort] flipped:[nsContext isFlipped] roundEnds:NO];
     } else {
@@ -485,7 +503,8 @@
 
 + (void)drawFinderLabelHighlight:(NSUInteger)label inRect:(NSRect)rect;
 {
-    if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_10) {
+    if (label == 0) {
+    } else if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_10) {
         NSGraphicsContext *nsContext = [NSGraphicsContext currentContext];
         [self _drawFinderLabel:label inRect:NSRectToCGRect(rect) 
ofContext:[nsContext graphicsPort] flipped:[nsContext isFlipped] roundEnds:YES];
     } else {

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



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to