Revision: 3100
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3100&view=rev
Author:   hofman
Date:     2007-10-30 06:32:18 -0700 (Tue, 30 Oct 2007)

Log Message:
-----------
Take indentation into account for auto sizing note rows.

Modified Paths:
--------------
    trunk/SKMainWindowController.m
    trunk/SKNotesDocument.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2007-10-30 13:18:19 UTC (rev 3099)
+++ trunk/SKMainWindowController.m      2007-10-30 13:32:18 UTC (rev 3100)
@@ -3594,6 +3594,7 @@
     id cell = [tableColumn dataCell];
     float width = NSWidth([cell drawingRectForBounds:NSMakeRect(0.0, 0.0, 
[tableColumn width] - 17.0, rowHeight)]);
     NSSize size = NSMakeSize(width, FLT_MAX);
+    NSSize smallSize = NSMakeSize(width - [noteOutlineView 
indentationPerLevel], FLT_MAX);
     
     NSMutableArray *items = [NSMutableArray array];
     id item = [sender representedObject];
@@ -3613,7 +3614,7 @@
         item = [items objectAtIndex:i];
         [cell setObjectValue:[item string]];
         NSAttributedString *attrString = [cell attributedStringValue];
-        NSRect rect = [attrString boundingRectWithSize:size 
options:NSStringDrawingUsesLineFragmentOrigin];
+        NSRect rect = [attrString boundingRectWithSize:[item type] ? size : 
smallSize options:NSStringDrawingUsesLineFragmentOrigin];
         [item setRowHeight:fmaxf(NSHeight(rect) + 3.0, rowHeight + 2.0)];
         row = [noteOutlineView rowForItem:item];
         if (row != -1)

Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m     2007-10-30 13:18:19 UTC (rev 3099)
+++ trunk/SKNotesDocument.m     2007-10-30 13:32:18 UTC (rev 3100)
@@ -232,6 +232,7 @@
     id cell = [tableColumn dataCell];
     float width = NSWidth([cell drawingRectForBounds:NSMakeRect(0.0, 0.0, 
[tableColumn width] - 17.0, rowHeight)]);
     NSSize size = NSMakeSize(width, FLT_MAX);
+    NSSize smallSize = NSMakeSize(width - [outlineView indentationPerLevel], 
FLT_MAX);
     
     NSMutableArray *items = [NSMutableArray array];
     id item = [sender representedObject];
@@ -251,7 +252,7 @@
         item = [items objectAtIndex:i];
         [cell setObjectValue:[item valueForKey:@"string"]];
         NSAttributedString *attrString = [cell attributedStringValue];
-        NSRect rect = [attrString boundingRectWithSize:size 
options:NSStringDrawingUsesLineFragmentOrigin];
+        NSRect rect = [attrString boundingRectWithSize:[item type] ? size : 
smallSize options:NSStringDrawingUsesLineFragmentOrigin];
         [item setValue:[NSNumber numberWithFloat:fmaxf(NSHeight(rect) + 3.0, 
rowHeight + 2.0)] forKey:@"rowHeight"];
         row = [outlineView rowForItem:item];
         if (row != -1)


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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to