Revision: 7568
http://skim-app.svn.sourceforge.net/skim-app/?rev=7568&view=rev
Author: hofman
Date: 2011-12-13 12:09:09 +0000 (Tue, 13 Dec 2011)
Log Message:
-----------
constrain cell size to size passed in
Modified Paths:
--------------
trunk/SKColorCell.m
trunk/SKSnapshotPageCell.m
trunk/SKTextWithIconCell.m
Modified: trunk/SKColorCell.m
===================================================================
--- trunk/SKColorCell.m 2011-12-12 16:28:34 UTC (rev 7567)
+++ trunk/SKColorCell.m 2011-12-13 12:09:09 UTC (rev 7568)
@@ -43,7 +43,7 @@
@implementation SKColorCell
- (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/SKSnapshotPageCell.m
===================================================================
--- trunk/SKSnapshotPageCell.m 2011-12-12 16:28:34 UTC (rev 7567)
+++ trunk/SKSnapshotPageCell.m 2011-12-13 12:09:09 UTC (rev 7568)
@@ -77,7 +77,7 @@
- (NSSize)cellSizeForBounds:(NSRect)aRect {
NSSize size = [super cellSizeForBounds:aRect];
- size.width = fmax(size.width, 16.0);
+ size.width = fmin(fmax(size.width, 16.0), NSWidth(aRect));
return size;
}
Modified: trunk/SKTextWithIconCell.m
===================================================================
--- trunk/SKTextWithIconCell.m 2011-12-12 16:28:34 UTC (rev 7567)
+++ trunk/SKTextWithIconCell.m 2011-12-13 12:09:09 UTC (rev 7568)
@@ -90,6 +90,7 @@
- (NSSize)cellSizeForBounds:(NSRect)aRect {
NSSize cellSize = [super cellSizeForBounds:aRect];
cellSize.width += cellSize.height - 1 + BORDER_BETWEEN_EDGE_AND_IMAGE +
BORDER_BETWEEN_IMAGE_AND_TEXT;
+ cellSize.width = fmin(cellSize.width, NSWidth(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/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit