Revision: 25419
          http://sourceforge.net/p/bibdesk/svn/25419
Author:   hofman
Date:     2021-01-17 15:39:02 +0000 (Sun, 17 Jan 2021)
Log Message:
-----------
don't draw shadow for alias and lock badges

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPDFIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVQuickLookIcon.m
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m    2021-01-17 
07:30:34 UTC (rev 25418)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFinderIcon.m    2021-01-17 
15:39:02 UTC (rev 25419)
@@ -214,8 +214,13 @@
     }
     
     // We could use Icon Services to draw the badge, but it draws pure alpha 
with a centered badge at large sizes.  It also results in an offset image 
relative to the grid.
-    if (_drawsLinkBadge)
+    if (_drawsLinkBadge) {
+        // get rid of any shadow, or we may draw a text shadow if the page is 
transparent
+        CGContextSaveGState(context);
+        CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
         [self _badgeIconInRect:dstRect ofContext:context];
+        CGContextRestoreGState(context);
+    }
 }
 
 @end

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageIcon.m     2021-01-17 
07:30:34 UTC (rev 25418)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVImageIcon.m     2021-01-17 
15:39:02 UTC (rev 25419)
@@ -274,15 +274,25 @@
         
         if (_loadFailed && nil != [self _fallbackIcon]) {
             [_fallbackIcon fastDrawInRect:dstRect ofContext:context];
-            if (_drawsLinkBadge)
+            if (_drawsLinkBadge) {
+                // get rid of any shadow, or we may draw a text shadow if the 
page is transparent
+                CGContextSaveGState(context);
+                CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
                 [self _badgeIconInRect:dstRect ofContext:context];
+                CGContextSaveGState(context);
+            }
         }
         
         if (_thumbnail) {
             CGContextDrawImage(context, [self _drawingRectWithRect:dstRect], 
_thumbnail);
             [self unlock];
-            if (_drawsLinkBadge)
+            if (_drawsLinkBadge) {
+                // get rid of any shadow, or we may draw a text shadow if the 
page is transparent
+                CGContextSaveGState(context);
+                CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
                 [self _badgeIconInRect:dstRect ofContext:context];
+                CGContextSaveGState(context);
+            }
         }
         else {
             [self unlock];
@@ -320,8 +330,13 @@
             [self _drawPlaceholderInRect:dstRect ofContext:context];
         }
         
-        if (_drawsLinkBadge)
+        if (_drawsLinkBadge) {
+            // get rid of any shadow, or we may draw a text shadow if the page 
is transparent
+            CGContextSaveGState(context);
+            CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
             [self _badgeIconInRect:dstRect ofContext:context];
+            CGContextSaveGState(context);
+        }
         
     }
     else {

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPDFIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPDFIcon.m       2021-01-17 
07:30:34 UTC (rev 25418)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVPDFIcon.m       2021-01-17 
15:39:02 UTC (rev 25419)
@@ -479,10 +479,14 @@
         CGRect drawRect = [self _drawingRectWithRect:dstRect];
         CGContextDrawImage(context, drawRect, _thumbnail);
         [self unlock];
+        // get rid of any shadow, or we may draw a text shadow if the page is 
transparent
+        CGContextSaveGState(context);
+        CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
         if (_isLocked)
             [self _drawLockBadgeInRect:drawRect ofContext:context];
         if (_drawsLinkBadge)
             [self _badgeIconInRect:dstRect ofContext:context];
+        CGContextRestoreGState(context);
     }
     else if (NULL != _pdfPage) {
         [self unlock];
@@ -557,8 +561,13 @@
         }
         else if (NULL != _thumbnail) {
             CGContextDrawImage(context, drawRect, _thumbnail);
-            if (_drawsLinkBadge)
+            if (_drawsLinkBadge) {
+                // get rid of any shadow, or we may draw a text shadow if the 
page is transparent
+                CGContextSaveGState(context);
+                CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
                 [self _badgeIconInRect:dstRect ofContext:context];
+                CGContextSaveGState(context);
+            }
         }
         else {
             // no doc and no thumbnail

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVQuickLookIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVQuickLookIcon.m 2021-01-17 
07:30:34 UTC (rev 25418)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVQuickLookIcon.m 2021-01-17 
15:39:02 UTC (rev 25419)
@@ -242,8 +242,13 @@
 
         [self _drawBackgroundAndImage:image inRect:dstRect ofContext:context];
         
-        if (_drawsLinkBadge)
+        if (_drawsLinkBadge) {
+            // get rid of any shadow, or we may draw a text shadow if the page 
is transparent
+            CGContextSaveGState(context);
+            CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
             [self _badgeIconInRect:dstRect ofContext:context];
+            CGContextSaveGState(context);
+        }
         
         [self unlock];
     }
@@ -250,8 +255,13 @@
     else if (NO == didLock && NULL != _thumbnail) {
         // no lock for thumbnail; if it exists, it's never released
         [self _drawBackgroundAndImage:_thumbnail inRect:dstRect 
ofContext:context];
-        if (_drawsLinkBadge)
+        if (_drawsLinkBadge) {
+            // get rid of any shadow, or we may draw a text shadow if the page 
is transparent
+            CGContextSaveGState(context);
+            CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
             [self _badgeIconInRect:dstRect ofContext:context];
+            CGContextSaveGState(context);
+        }
     }
     else if (_quickLookFailed && nil != _fallbackIcon) {
         [_fallbackIcon drawInRect:dstRect ofContext:context];

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m      2021-01-17 
07:30:34 UTC (rev 25418)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVTextIcon.m      2021-01-17 
15:39:02 UTC (rev 25419)
@@ -124,8 +124,13 @@
     else if (_thumbnail) {
         CGContextDrawImage(context, [self _drawingRectWithRect:dstRect], 
_thumbnail);
         [self unlock];
-        if (_drawsLinkBadge)
+        if (_drawsLinkBadge) {
+            // get rid of any shadow, or we may draw a text shadow if the page 
is transparent
+            CGContextSaveGState(context);
+            CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
             [self _badgeIconInRect:dstRect ofContext:context];
+            CGContextSaveGState(context);
+        }
     }
     else {
         [self unlock];
@@ -150,8 +155,13 @@
         if (toDraw) {
             CGContextDrawImage(context, drawRect, toDraw);
             [self unlock];
-            if (_drawsLinkBadge)
+            if (_drawsLinkBadge) {
+                // get rid of any shadow, or we may draw a text shadow if the 
page is transparent
+                CGContextSaveGState(context);
+                CGContextSetShadowWithColor(context, CGSizeZero, 0, NULL);
                 [self _badgeIconInRect:dstRect ofContext:context];
+                CGContextSaveGState(context);
+            }
         }
         else {
             [self unlock];

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to