Revision: 29179
          http://sourceforge.net/p/bibdesk/svn/29179
Author:   hofman
Date:     2025-04-23 22:17:42 +0000 (Wed, 23 Apr 2025)
Log Message:
-----------
Revert previous changes. Allways update highlight rect after recalculating 
grid. The view frame may have changed before this call.

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

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2025-04-23 
22:11:12 UTC (rev 29178)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2025-04-23 
22:17:42 UTC (rev 29179)
@@ -267,7 +267,7 @@
 - (FVIcon *)_cachedIconForURL:(NSURL *)aURL;
 - (void)_getDisplayName:(NSString **)name label:(NSUInteger *)label 
isFile:(BOOL *)isFile forURL:(NSURL *)aURL;
 - (NSSize)_paddingForScale:(CGFloat)scale;
-- (BOOL)_recalculateGridSize;
+- (void)_recalculateGridSize;
 - (void)_reloadIcons;
 - (void)_resetViewLayout;
 - (void)_resetTrackingRectsAndToolTips;
@@ -1103,7 +1103,6 @@
     NSScrollView *scrollView = [self enclosingScrollView];
     if ((scrollView && [[notification object] isEqual:[self superview]]) || 
(scrollView == nil && [[notification object] isEqual:self])) {
         [self _recalculateGridSize];
-        [self _updateHighlightRects];
         if (scrollView)
             [_backgroundView setFrame:[scrollView bounds]];
     }
@@ -1153,8 +1152,8 @@
     if (superview) {
         [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(_handleSuperviewDidResize:) 
name:NSViewFrameDidChangeNotification object:observedView];
         
-        if ([self _recalculateGridSize])
-            [self _updateHighlightRects];
+        [self _recalculateGridSize];
+        
         [[self window] invalidateCursorRectsForView:self];
         if ([self window] && [[self window] isKeyWindow] == NO)
             [self resetCursorRects];
@@ -1303,7 +1302,7 @@
     return contentSize;
 }
 
-- (BOOL)_recalculateGridSize
+- (void)_recalculateGridSize
 {
     NSScrollView *scrollView = [self enclosingScrollView];
     NSSize contentSize = scrollView ? [scrollView contentSize] : [self 
bounds].size;
@@ -1311,8 +1310,6 @@
     if ([scrollView respondsToSelector:@selector(scrollerStyle)] == NO || 
[scrollView scrollerStyle] == NSScrollerStyleLegacy)
         autoHidesScrollers = [scrollView autohidesScrollers];
     
-    BOOL changed = NO;
-    
     if (_fvFlags.displayMode == FVDisplayModeColumn) {
         
         _numberOfColumns = 1;
@@ -1352,13 +1349,9 @@
             [self willChangeValueForKey:@"iconScale"];
             _iconSize = iconSize;
             [self didChangeValueForKey:@"iconScale"];
-            changed = YES;
         }
         
-        if (NSEqualSizes(padding, _padding) == NO) {
-            _padding = padding;
-            changed = YES;
-        }
+        _padding = padding;
         
     } else if (_fvFlags.displayMode == FVDisplayModeRow) {
         
@@ -1399,13 +1392,9 @@
             [self willChangeValueForKey:@"iconScale"];
             _iconSize = iconSize;
             [self didChangeValueForKey:@"iconScale"];
-            changed = YES;
         }
         
-        if (NSEqualSizes(padding, _padding) == NO) {
-            _padding = padding;
-            changed = YES;
-        }
+        _padding = padding;
         
     } else {
         
@@ -1435,8 +1424,6 @@
             
         }
         
-        changed = _numberOfColumns != numberOfColumns || _numberOfRows != 
numberOfRows;
-        
         _numberOfColumns = numberOfColumns;
         _numberOfRows = numberOfRows;
     }
@@ -1457,12 +1444,11 @@
                     frame.size.height = contentSize.height;
                 [super setFrame:frame];
             }
-            changed = YES;
         }
         
     }
     
-    return changed;
+    [self _updateHighlightRects];
 }
 
 - (NSUInteger)_indexForGridRow:(NSUInteger)rowIndex 
column:(NSUInteger)colIndex;
@@ -1794,8 +1780,6 @@
     // Problem exposed in BibDesk: select all, scroll halfway down in file 
pane, then change selection to a single row.  FVFileView content didn't update 
correctly, even though reloadIcons was called.  Logging drawRect: indicated 
that the wrong region was being updated, but calling _recalculateGridSize here 
fixed it.
     [self _recalculateGridSize];
     
-    [self _updateHighlightRects];
-    
     // We may have to change the frames of the progress indicators.
     [self _updateProgressIndicatorFrames];
     

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