Revision: 24194
          http://sourceforge.net/p/bibdesk/svn/24194
Author:   hofman
Date:     2019-09-05 14:24:43 +0000 (Thu, 05 Sep 2019)
Log Message:
-----------
separate option to draw highlights

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

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-09-05 
14:06:04 UTC (rev 24193)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-09-05 
14:24:43 UTC (rev 24194)
@@ -2318,7 +2318,7 @@
     }
 }
 
-enum { FVDrawIcon = 1, FVDrawText = 2, FVDrawFull = 7 };
+enum { FVDrawIcon = 1<<0, FVDrawText = 1<<1, FVDrawHighlight = 1<<2, 
FVDrawView = FVDrawIcon | FVDrawText | FVDrawHighlight };
 
 - (void)_drawIconsInRows:(NSRange)rows columns:(NSRange)columns 
drawOption:(NSUInteger)drawOption
 {
@@ -2372,7 +2372,7 @@
             i = [self _indexForGridRow:r column:c];
 
             // if we're creating a drag image, only draw selected icons
-            if (NSNotFound != i && (FVDrawFull == drawOption || 
[_selectionIndexes containsIndex:i])) {
+            if (NSNotFound != i && (FVDrawView == drawOption || 
[_selectionIndexes containsIndex:i])) {
             
                 NSRect fileRect = [self _rectOfIconInRow:r column:c];
                 
@@ -2379,7 +2379,7 @@
                 // allow some extra for the shadow (-5)
                 NSRect textRect = [self _rectOfTextForIconRect:fileRect];
                 // always draw icon and text together, as they may overlap due 
to shadow and finder label, and redrawing a part may look odd
-                BOOL willDrawIcon = FVDrawFull != drawOption || [self 
needsToDrawRect:NSUnionRect(NSInsetRect(fileRect, -2.0 * [self iconScale], 
-[self iconScale]), textRect)];
+                BOOL willDrawIcon = FVDrawView != drawOption || [self 
needsToDrawRect:NSUnionRect(NSInsetRect(fileRect, -2.0 * [self iconScale], 
-[self iconScale]), textRect)];
                                 
                 if (willDrawIcon) {
 
@@ -2389,7 +2389,7 @@
                     NSRect iconRect = fileRect;
                     
                     // draw highlight, then draw icon over it, as Finder does
-                    if (FVDrawFull == drawOption && [_selectionIndexes 
containsIndex:i])
+                    if ((FVDrawHighlight | drawOption) && [_selectionIndexes 
containsIndex:i])
                         [self _drawHighlightInRect:NSInsetRect(fileRect, 
HIGHLIGHT_INSET, HIGHLIGHT_INSET)];
                     
                     if ((FVDrawIcon & drawOption)) {
@@ -2572,7 +2572,7 @@
     
     // only draw icons if we actually have some in this rect
     if (iMax > iMin) {
-        [self _drawIconsInRows:rowRange columns:columnRange 
drawOption:FVDrawFull];
+        [self _drawIconsInRows:rowRange columns:columnRange 
drawOption:FVDrawView];
         
         // avoid hitting the cache thread while a live resize is in progress, 
but allow cache updates while scrolling
         // use the same range criteria that we used in iterating icons

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