Revision: 7575
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7575&view=rev
Author:   hofman
Date:     2011-12-15 23:46:35 +0000 (Thu, 15 Dec 2011)
Log Message:
-----------
override cellSize to get expansion frame

Modified Paths:
--------------
    trunk/SKProgressCell.m

Modified: trunk/SKProgressCell.m
===================================================================
--- trunk/SKProgressCell.m      2011-12-15 23:23:17 UTC (rev 7574)
+++ trunk/SKProgressCell.m      2011-12-15 23:46:35 UTC (rev 7575)
@@ -135,13 +135,24 @@
     [statusCell setObjectValue:statusDescription];
 }
 
+- (NSSize)cellSizeForBounds:(NSRect)aRect {
+    NSSize cellSize = [super cellSizeForBounds:aRect];
+    if (nil == objectValueForKey([self objectValue], 
SKDownloadProgressIndicatorKey)) {
+        NSSize statusSize = [statusCell cellSize];
+        cellSize.width = fmax(cellSize.width, statusSize.width);
+        cellSize.height += statusSize.height + MARGIN_Y;
+    }
+    cellSize.width += MARGIN_X;
+    return cellSize;
+}
+
 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
     NSProgressIndicator *progressIndicator = objectValueForKey([self 
objectValue], SKDownloadProgressIndicatorKey);
     NSRectEdge bottomEdge = [controlView isFlipped] ? NSMaxYEdge : NSMinYEdge;
     NSRectEdge topEdge = [controlView isFlipped] ? NSMinYEdge : NSMaxYEdge;
     NSRect insetRect = SKShrinkRect(NSInsetRect(cellFrame, MARGIN_X, 0.0), 
MARGIN_Y, bottomEdge);
     
-    [super drawWithFrame:SKSliceRect(insetRect, [super cellSize].height, 
topEdge) inView:controlView];
+    [super drawWithFrame:SKSliceRect(insetRect, [super 
cellSizeForBounds:cellFrame].height, topEdge) inView:controlView];
     
     if (progressIndicator) {
         [progressIndicator setFrame:SKSliceRect(insetRect, 
NSHeight([progressIndicator frame]), bottomEdge)];
@@ -164,17 +175,6 @@
         [statusCell drawWithFrame:SKSliceRect(insetRect, [statusCell 
cellSize].height, bottomEdge) inView:controlView];
 }
 
-- (NSRect)expansionFrameWithFrame:(NSRect)cellFrame inView:(NSView *)view {
-    NSRect rect = [super expansionFrameWithFrame:cellFrame inView:view];
-    if (nil == objectValueForKey([self objectValue], 
SKDownloadProgressIndicatorKey)) {
-        NSSize statusSize = [statusCell cellSize];
-        rect.size.width = fmax(NSWidth(rect), statusSize.width);
-        rect.size.height += statusSize.height + MARGIN_Y;
-    }
-    rect.size.width += MARGIN_X;
-    return rect;
-}
-
 #pragma mark Accessibility
 
 - (id)accessibilityAttributeNames {

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


------------------------------------------------------------------------------
10 Tips for Better Server Consolidation
Server virtualization is being driven by many needs.  
But none more important than the need to reduce IT complexity 
while improving strategic productivity.  Learn More! 
http://www.accelacomm.com/jaw/sdnl/114/51507609/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to