Revision: 22209
          http://sourceforge.net/p/bibdesk/svn/22209
Author:   hofman
Date:     2018-05-03 16:32:11 +0000 (Thu, 03 May 2018)
Log Message:
-----------
only account for scroller width when scrollers are shown

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m
    trunk/bibdesk/BDSKTextViewCompletionController.m

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2018-05-03 14:39:10 UTC (rev 22208)
+++ trunk/bibdesk/BDSKEditor.m  2018-05-03 16:32:11 UTC (rev 22209)
@@ -87,6 +87,7 @@
 #import "NSTextView_BDSKExtensions.h"
 #import "NSError_BDSKExtensions.h"
 #import "NSPasteboard_BDSKExtensions.h"
+#import "NSScrollView_BDSKExtensions.h"
 
 #define WEAK_NULL NULL
 
@@ -3396,7 +3397,10 @@
     numCols = MAX(numCols, 1);
     numRows = (numEntries + numCols - 1) / numCols;
     if (numRows * (cellSize.height + spacing.height) > 190.0 + spacing.height) 
{
-        numCols = MIN(floor((size.width - [NSScroller scrollerWidth] + 
spacing.width) / colWidth), numEntries);
+        if ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)] 
== NO || [NSScroller preferredScrollerStyle] == NSScrollerStyleLegacy)
+            numCols = MIN(floor((size.width - [NSScroller scrollerWidth] + 
spacing.width) / colWidth), numEntries);
+        else
+            numCols = MIN(floor((size.width + spacing.width) / colWidth), 
numEntries);
         numRows = (numEntries + numCols - 1) / numCols;
     }
     if (columns)

Modified: trunk/bibdesk/BDSKTextViewCompletionController.m
===================================================================
--- trunk/bibdesk/BDSKTextViewCompletionController.m    2018-05-03 14:39:10 UTC 
(rev 22208)
+++ trunk/bibdesk/BDSKTextViewCompletionController.m    2018-05-03 16:32:11 UTC 
(rev 22209)
@@ -37,6 +37,7 @@
  */
 
 #import "BDSKTextViewCompletionController.h"
+#import "NSScrollView_BDSKExtensions.h"
 
 @interface BDSKTextViewCompletionWindow : NSWindow @end
 
@@ -384,8 +385,10 @@
                [cell setStringValue:[labels objectAtIndex:count]];
                hSize = fmax(hSize, [cell cellSize].width);
        }
-       hSize += [NSScroller scrollerWidth] + [tableView 
intercellSpacing].width;
-    
+       hSize += [tableView intercellSpacing].width;
+    if ([NSScroller respondsToSelector:@selector(preferredScrollerStyle)] == 
NO || [NSScroller preferredScrollerStyle] == NSScrollerStyleLegacy)
+        hSize += [NSScroller scrollerWidth];
+
        CGFloat vSize = NSHeight(NSUnionRect([tableView rectOfRow:0], 
[tableView rectOfRow:[tableView numberOfRows] - 1]));
        
        return NSMakeSize(ceil(hSize), ceil(vSize));

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to