Revision: 24144
          http://sourceforge.net/p/bibdesk/svn/24144
Author:   hofman
Date:     2019-08-16 22:28:24 +0000 (Fri, 16 Aug 2019)
Log Message:
-----------
don't need to take into account scroller width when using overlay scrollers

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-08-16 
21:03:00 UTC (rev 24143)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVFileView.m      2019-08-16 
22:28:24 UTC (rev 24144)
@@ -1222,6 +1222,12 @@
     return [[scroller class] scrollerWidthForControlSize:[scroller 
controlSize]];
 }
 
+static BOOL _scrollViewAutohidesScrollers(NSScrollView *scrollView) {
+    if ([scrollView respondsToSelector:@selector(scrollerStyle)] && 
[scrollView scrollerStyle] == NSScrollerStyleOverlay)
+        return NO;
+    return [scrollView autohidesScrollers];
+}
+
 - (NSSize)_contentSizeForScrollView:(NSScrollView *)scrollView 
minWidth:(CGFloat)minWidth hasVerticalScroller:(BOOL)hasVerticalScroller {
     // NSScrollView does not have a method to get the content size for 
arbitrary controlSize, so we substract the scroller widths ourselves
     NSSize contentSize = [[scrollView class] 
contentSizeForFrameSize:[scrollView frame].size hasHorizontalScroller:NO 
hasVerticalScroller:NO borderType:[scrollView borderType]];
@@ -1255,7 +1261,7 @@
         _numberOfRows = [self numberOfIcons];
         
         // if we have an auto-hiding vertical scroller, we may or may not have 
scroll bars, which affects the effective width
-        if ([scrollView autohidesScrollers] && [scrollView 
hasVerticalScroller]) {
+        if (_scrollViewAutohidesScrollers(scrollView) && [scrollView 
hasVerticalScroller]) {
             CGFloat minWidth = ceil( DEFAULT_PADDING.width + 
MIN_AUTO_ICON_SCALE * DEFAULT_ICON_SIZE.width + 2 * DEFAULT_MARGIN.width );
             
             // first assume we need a vertical scroller...
@@ -1289,7 +1295,7 @@
         _numberOfRows = 1;
         
         // if we have an auto-hiding horizontal scroller, we may or may not 
have scroll bars, which affects the effective height
-        if ([scrollView autohidesScrollers] && [scrollView 
hasHorizontalScroller]) {
+        if (_scrollViewAutohidesScrollers(scrollView) && [scrollView 
hasHorizontalScroller]) {
             CGFloat minHeight = ceil( DEFAULT_PADDING.height + 
MIN_AUTO_ICON_SCALE * DEFAULT_ICON_SIZE.height + DEFAULT_MARGIN.height );
             
             // first assume we need a horizontal scroller...
@@ -1322,7 +1328,7 @@
         _padding = [self _paddingForScale:[self iconScale]];
         
         // if we have an auto-hiding vertical scroller, we may or may not have 
scroll bars, which affects the effective width
-        if ([scrollView autohidesScrollers] && [scrollView 
hasVerticalScroller]) {
+        if (_scrollViewAutohidesScrollers(scrollView) && [scrollView 
hasVerticalScroller]) {
             // set the number of columns to 1 to calculate the minimal 
required width
             _numberOfColumns = 1;
             CGFloat minWidth = [self _frameWidth];

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