Revision: 15162
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15162&view=rev
Author:   hofman
Date:     2009-04-23 00:23:15 +0000 (Thu, 23 Apr 2009)

Log Message:
-----------
put horizontal insertion drop highlights vertically between icons in column 
mode 

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

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2009-04-22 
23:49:38 UTC (rev 15161)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2009-04-23 
00:23:15 UTC (rev 15162)
@@ -1636,6 +1636,7 @@
     NSBezierPath *p;
     NSUInteger r, c;
     NSRect aRect = NSZeroRect;
+    BOOL isColumn = (_fvFlags.displayMode == FVDisplayModeColumn);
     
     switch (_dropOperation) {
         case FVDropOn:
@@ -1649,16 +1650,26 @@
         case FVDropBefore:
             [self _getGridRow:&r column:&c ofIndex:_dropIndex];
             aRect = [self _rectOfIconInRow:r column:c];
-            // aRect size is 6, and should be centered between icons 
horizontally
-            aRect.origin.x -= _padding.width / 2 + 3.0;
-            aRect.size.width = 6.0;    
+            // aRect size is 6, and should be centered between icons
+            if (isColumn) {
+                aRect.origin.y -= 6.0;
+                aRect.size.height = 6.0;
+            } else {
+                aRect.origin.x -= _padding.width / 2 + 3.0;
+                aRect.size.width = 6.0;    
+            }
             break;
         case FVDropAfter:
             [self _getGridRow:&r column:&c ofIndex:_dropIndex];
             aRect = [self _rectOfIconInRow:r column:c];
-            // aRect size is 6, and should be centered between icons 
horizontally
-            aRect.origin.x += _iconSize.width + _padding.width / 2 - 3.0;
-            aRect.size.width = 6.0;
+            // aRect size is 6, and should be centered between icons
+            if (isColumn) {
+                aRect.origin.y += _iconSize.height + _padding.height - 6.0;
+                aRect.size.height = 6.0;
+            } else {
+                aRect.origin.x += _iconSize.width + _padding.width / 2 - 3.0;
+                aRect.size.width = 6.0;
+            }
             break;
         default:
             break;
@@ -1675,6 +1686,15 @@
             p = [NSBezierPath fv_bezierPathWithRoundRect:NSInsetRect(aRect, 
0.5 * lineWidth, 0.5 * lineWidth) xRadius:7 yRadius:7];
             [p fill];
         }
+        else if (isColumn) {
+            // similar to NSTableView's between-row drop indicator
+            CGFloat radius = NSHeight(aRect) / 2;
+            NSPoint point = NSMakePoint(NSMaxX(aRect), NSMidY(aRect));
+            p = [NSBezierPath bezierPath];
+            [p appendBezierPathWithArcWithCenter:point radius:radius 
startAngle:-180 endAngle:180];
+            point.x = NSMinX(aRect);
+            [p appendBezierPathWithArcWithCenter:point radius:radius 
startAngle:0 endAngle:360];
+        }
         else {
             // similar to NSTableView's between-row drop indicator
             CGFloat radius = NSWidth(aRect) / 2;
@@ -2296,6 +2316,22 @@
     // First determine the drop location, check whether the index is not 
NSNotFound, because the grid cell can be empty
     if ([self _getGridRow:&r column:&c atPoint:p] && NSNotFound != (_dropIndex 
= [self _indexForGridRow:r column:c])) {
         _dropOperation = FVDropOn;
+    } else if (_fvFlags.displayMode == FVDisplayModeColumn) {
+        p = NSMakePoint(dragLoc.x, dragLoc.y + _iconSize.height - 0.5);
+
+        if ([self _getGridRow:&r column:&c atPoint:p] && NSNotFound != 
(_dropIndex = [self _indexForGridRow:r column:c])) {
+            _dropOperation = FVDropBefore;
+        } else {
+            p = NSMakePoint(dragLoc.x, dragLoc.y - _iconSize.height + 0.5);
+            
+            if ([self _getGridRow:&r column:&c atPoint:p] && NSNotFound != 
(_dropIndex = [self _indexForGridRow:r column:c])) {
+                _dropOperation = FVDropAfter;
+            } else {
+                // drop on the whole view
+                _dropOperation = FVDropOn;
+                _dropIndex = NSNotFound;
+            }
+        }
     } else {
         p = NSMakePoint(dragLoc.x + _iconSize.width - 0.5, dragLoc.y);
 


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

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to