Revision: 2928
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2928&view=rev
Author:   hofman
Date:     2007-09-15 13:44:24 -0700 (Sat, 15 Sep 2007)

Log Message:
-----------
Show count of bookmark folder in file column.

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

Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m        2007-09-15 20:33:23 UTC (rev 2927)
+++ trunk/SKBookmarkController.m        2007-09-15 20:44:24 UTC (rev 2928)
@@ -162,7 +162,7 @@
             message = [bookmark resolvedPath];
         } else if ([bookmark bookmarkType] == SKBookmarkTypeFolder) {
             int count = [[bookmark children] count];
-            message = count == 1 ? NSLocalizedString(@"1 item", @"Status 
message") : [NSString stringWithFormat:NSLocalizedString(@"%i items", @"Status 
message"), count];
+            message = count == 1 ? NSLocalizedString(@"1 item", @"Bookmark 
folder description") : [NSString stringWithFormat:NSLocalizedString(@"%i 
items", @"Bookmark folder description"), count];
         }
     }
     [statusBar setLeftStringValue:message];
@@ -475,7 +475,12 @@
     if ([tcID isEqualToString:@"label"]) {
         return [NSDictionary dictionaryWithObjectsAndKeys:[item label], 
SKTextWithIconCellStringKey, [item icon], SKTextWithIconCellImageKey, nil];
     } else if ([tcID isEqualToString:@"file"]) {
-        return [item resolvedPath];
+        if ([item bookmarkType] == SKBookmarkTypeFolder) {
+            int count = [[item children] count];
+            return count == 1 ? NSLocalizedString(@"1 item", @"Bookmark folder 
description") : [NSString stringWithFormat:NSLocalizedString(@"%i items", 
@"Bookmark folder description"), count];
+        } else {
+            return [item resolvedPath];
+        }
     } else if ([tcID isEqualToString:@"page"]) {
         return [[item pageNumber] stringValue];
     }
@@ -550,6 +555,15 @@
 
 #pragma mark NSOutlineView delegate methods
 
+- (void)outlineView:(NSOutlineView *)ov willDisplayCell:(id)cell 
forTableColumn:(NSTableColumn *)tableColumn item:(id)item {
+    if ([[tableColumn identifier] isEqualToString:@"file"]) {
+        if ([item bookmarkType] == SKBookmarkTypeFolder)
+            [cell setTextColor:[NSColor disabledControlTextColor]];
+        else
+            [cell setTextColor:[NSColor controlTextColor]];
+    }
+}
+
 - (BOOL)outlineView:(NSOutlineView *)ov shouldEditTableColumn:(NSTableColumn 
*)tableColumn item:(id)item {
     return [[tableColumn identifier] isEqualToString:@"label"] && [item 
bookmarkType] != SKBookmarkTypeSeparator;
 }


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to