Revision: 18313
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=18313&view=rev
Author:   hofman
Date:     2011-12-13 12:16:22 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
constrain cell size to size passed in

Modified Paths:
--------------
    trunk/bibdesk/BDSKAddressTextFieldCell.m
    trunk/bibdesk/BDSKEditorTextFieldCell.m
    trunk/bibdesk/BDSKGroupCell.m
    trunk/bibdesk/BDSKImagePopUpButtonCell.m
    trunk/bibdesk/BDSKMainTableView.m
    trunk/bibdesk/BDSKRatingButtonCell.m
    trunk/bibdesk/BDSKTextWithIconCell.m

Modified: trunk/bibdesk/BDSKAddressTextFieldCell.m
===================================================================
--- trunk/bibdesk/BDSKAddressTextFieldCell.m    2011-12-13 07:35:13 UTC (rev 
18312)
+++ trunk/bibdesk/BDSKAddressTextFieldCell.m    2011-12-13 12:16:22 UTC (rev 
18313)
@@ -45,7 +45,7 @@
 
 - (NSSize)cellSizeForBounds:(NSRect)aRect {
     NSSize cellSize = [super cellSizeForBounds:aRect];
-    cellSize.height += 1.0;
+    cellSize.height = fmin(cellSize.height + 1.0, NSHeight(aRect));
     return cellSize;
 }
 

Modified: trunk/bibdesk/BDSKEditorTextFieldCell.m
===================================================================
--- trunk/bibdesk/BDSKEditorTextFieldCell.m     2011-12-13 07:35:13 UTC (rev 
18312)
+++ trunk/bibdesk/BDSKEditorTextFieldCell.m     2011-12-13 12:16:22 UTC (rev 
18313)
@@ -223,7 +223,7 @@
 - (NSSize)cellSizeForBounds:(NSRect)aRect {
     NSSize cellSize = [super cellSizeForBounds:aRect];
     if ([self hasButton] || [self URL])
-        cellSize.width += BUTTON_SIZE.width + BUTTON_MARGIN;
+        cellSize.width = fmin(cellSize.width + BUTTON_SIZE.width + 
BUTTON_MARGIN, NSWidth(aRect));
     return cellSize;
 }
 

Modified: trunk/bibdesk/BDSKGroupCell.m
===================================================================
--- trunk/bibdesk/BDSKGroupCell.m       2011-12-13 07:35:13 UTC (rev 18312)
+++ trunk/bibdesk/BDSKGroupCell.m       2011-12-13 12:16:22 UTC (rev 18313)
@@ -287,6 +287,8 @@
     cellSize.width += BORDER_BETWEEN_EDGE_AND_IMAGE + iconHeight + 
BORDER_BETWEEN_IMAGE_AND_TEXT;
     if (countSize.width > 0.0)
         cellSize.width += BORDER_BETWEEN_COUNT_AND_TEXT + countSize.width + 
BORDER_BETWEEN_EDGE_AND_COUNT;
+    cellSize.width = fmin(cellSize.width, NSWidth(aRect));
+    cellSize.height = fmin(cellSize.height, NSHeight(aRect));
     return cellSize;
 }
 

Modified: trunk/bibdesk/BDSKImagePopUpButtonCell.m
===================================================================
--- trunk/bibdesk/BDSKImagePopUpButtonCell.m    2011-12-13 07:35:13 UTC (rev 
18312)
+++ trunk/bibdesk/BDSKImagePopUpButtonCell.m    2011-12-13 12:16:22 UTC (rev 
18313)
@@ -112,6 +112,7 @@
        } else if ([self arrowPosition] != NSPopUpNoArrow) {
         size.width += 7.0;
     }
+    size.width = fmin(size.width, NSWidth(aRect));
     return size;
 }
 

Modified: trunk/bibdesk/BDSKMainTableView.m
===================================================================
--- trunk/bibdesk/BDSKMainTableView.m   2011-12-13 07:35:13 UTC (rev 18312)
+++ trunk/bibdesk/BDSKMainTableView.m   2011-12-13 12:16:22 UTC (rev 18313)
@@ -783,7 +783,7 @@
 @implementation BDSKColorCell
 
 - (NSSize)cellSizeForBounds:(NSRect)aRect {
-    return NSMakeSize(16.0, 16.0);
+    return NSMakeSize(fmin(16.0, NSWidth(aRect)), fmin(16.0, NSHeight(aRect)));
 }
 
 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {

Modified: trunk/bibdesk/BDSKRatingButtonCell.m
===================================================================
--- trunk/bibdesk/BDSKRatingButtonCell.m        2011-12-13 07:35:13 UTC (rev 
18312)
+++ trunk/bibdesk/BDSKRatingButtonCell.m        2011-12-13 12:16:22 UTC (rev 
18313)
@@ -247,6 +247,10 @@
                                size.width -= EXTRA_BORDER_MARGIN;
                        break;
        }
+    
+    size.width = fmin(size.width, NSWidth(aRect));
+    size.height = fmin(size.height, NSHeight(aRect));
+    
        return size;
 }
 

Modified: trunk/bibdesk/BDSKTextWithIconCell.m
===================================================================
--- trunk/bibdesk/BDSKTextWithIconCell.m        2011-12-13 07:35:13 UTC (rev 
18312)
+++ trunk/bibdesk/BDSKTextWithIconCell.m        2011-12-13 12:16:22 UTC (rev 
18313)
@@ -119,6 +119,8 @@
         cellSize.width += cellSize.height - 
BORDER_BETWEEN_EDGE_AND_IMAGE_BEZELED + BORDER_BETWEEN_IMAGE_AND_TEXT_BEZELED;
     else
         cellSize.width += cellSize.height - 1 + 
BORDER_BETWEEN_EDGE_AND_IMAGE_BORDERLESS + 
BORDER_BETWEEN_IMAGE_AND_TEXT_BORDERLESS;
+    cellSize.width = fmin(cellSize.width, NSWidth(aRect));
+    cellSize.height = fmin(cellSize.height, NSHeight(aRect));
     return cellSize;
 }
 

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


------------------------------------------------------------------------------
Systems Optimization Self Assessment
Improve efficiency and utilization of IT resources. Drive out cost and 
improve service delivery. Take 5 minutes to use this Systems Optimization 
Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to