Revision: 22397
          http://sourceforge.net/p/bibdesk/svn/22397
Author:   hofman
Date:     2018-07-10 13:27:22 +0000 (Tue, 10 Jul 2018)
Log Message:
-----------
draw small note with paperclip instead of heavier paperclip when a file has 
Skim notes

Modified Paths:
--------------
    trunk/bibdesk/BibItem.m
    trunk/bibdesk/NSImage_BDSKExtensions.h
    trunk/bibdesk/NSImage_BDSKExtensions.m

Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m     2018-07-10 06:30:37 UTC (rev 22396)
+++ trunk/bibdesk/BibItem.m     2018-07-10 13:27:22 UTC (rev 22397)
@@ -1481,7 +1481,7 @@
                     break;
                 }
             }
-            NSImage *image = hasSkimNotes ? (hasMissingFile ? [NSImage 
redHeavyPaperclipImage] : [NSImage heavyPaperclipImage]) : (hasMissingFile ? 
[NSImage redPaperclipImage] : [NSImage paperclipImage]);
+            NSImage *image = hasSkimNotes ? (hasMissingFile ? [NSImage 
redAnnotatedPaperclipImage] : [NSImage annotatedPaperclipImage]) : 
(hasMissingFile ? [NSImage redPaperclipImage] : [NSImage paperclipImage]);
             cellDictionary = [NSDictionary dictionaryWithObjectsAndKeys:image, 
BDSKTextWithIconImageKey, label, BDSKTextWithIconStringKey, nil];
         }
         return cellDictionary;

Modified: trunk/bibdesk/NSImage_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSImage_BDSKExtensions.h      2018-07-10 06:30:37 UTC (rev 
22396)
+++ trunk/bibdesk/NSImage_BDSKExtensions.h      2018-07-10 13:27:22 UTC (rev 
22397)
@@ -49,8 +49,8 @@
 + (NSImage *)cautionImage;
 + (NSImage *)paperclipImage;
 + (NSImage *)redPaperclipImage;
-+ (NSImage *)heavyPaperclipImage;
-+ (NSImage *)redHeavyPaperclipImage;
++ (NSImage *)annotatedPaperclipImage;
++ (NSImage *)redAnnotatedPaperclipImage;
 + (NSImage *)addBookmarkToolbarImage;
 + (NSImage *)addFolderToolbarImage;
 + (NSImage *)addSeparatorToolbarImage;

Modified: trunk/bibdesk/NSImage_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSImage_BDSKExtensions.m      2018-07-10 06:30:37 UTC (rev 
22396)
+++ trunk/bibdesk/NSImage_BDSKExtensions.m      2018-07-10 13:27:22 UTC (rev 
22397)
@@ -300,7 +300,7 @@
     return [[NSWorkspace sharedWorkspace] 
iconForFileType:NSFileTypeForHFSTypeCode(typeCode)];
 }
 
-static NSImage *createPaperclipImageWithColor(NSColor *color, BOOL heavy) {
+static NSImage *createPaperclipImageWithColor(NSColor *color, BOOL annotated) {
     NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize(32.0, 32.0)];
     [image setBackgroundColor:[NSColor clearColor]];
     
@@ -315,10 +315,21 @@
     [path appendBezierPathWithArcWithCenter:NSMakePoint(0.0, 16.0) radius:2.0 
startAngle:0.0 endAngle:180.0 clockwise:YES];
     [path lineToPoint:NSMakePoint(-2.0, 30.0)];
     [path transformUsingAffineTransform:t];
-    
+    if (annotated) {
+        [path moveToPoint:NSMakePoint(20.0, 2.0)];
+        [path lineToPoint:NSMakePoint(20.0, 12.0)];
+        [path lineToPoint:NSMakePoint(30.0, 12.0)];
+        [path lineToPoint:NSMakePoint(30.0, 5.0)];
+        [path lineToPoint:NSMakePoint(27.0, 2.0)];
+        [path closePath];
+        [path moveToPoint:NSMakePoint(30.0, 5.0)];
+        [path lineToPoint:NSMakePoint(27.0, 5.0)];
+        [path lineToPoint:NSMakePoint(27.0, 2.0)];
+    }
+
     [image lockFocus];
     [color setStroke];
-    [path setLineWidth:heavy ? 3.2 : 2.0];
+    [path setLineWidth:2.0];
     [path stroke];
     [image unlockFocus];
     
@@ -329,7 +340,7 @@
     NSImage *tinyImage = [[NSImage alloc] initWithSize:NSMakeSize(16.0, 16.0)];
     [tinyImage lockFocus];
     [color setStroke];
-    [path setLineWidth:heavy ? 1.6 : 1.0];
+    [path setLineWidth:1.0];
     [path stroke];
     [tinyImage unlockFocus];
     
@@ -343,13 +354,13 @@
 {
     static NSImage *image = nil;
     if(image == nil) {
-        image = createPaperclipImageWithColor([NSColor 
colorWithCalibratedWhite:0.0 alpha:0.8], NO);
+        image = createPaperclipImageWithColor([NSColor 
colorWithCalibratedWhite:0.0 alpha:0.9], NO);
         [image setTemplate:YES];
     }
     return image;
 }
 
-+ (NSImage *)redHeavyPaperclipImage;
++ (NSImage *)redAnnotatedPaperclipImage;
 {
     static NSImage *image = nil;
     if(image == nil)
@@ -357,11 +368,11 @@
     return image;
 }
 
-+ (NSImage *)heavyPaperclipImage;
++ (NSImage *)annotatedPaperclipImage;
 {
     static NSImage *image = nil;
     if(image == nil) {
-        image = createPaperclipImageWithColor([NSColor 
colorWithCalibratedWhite:0.0 alpha:0.8], YES);
+        image = createPaperclipImageWithColor([NSColor 
colorWithCalibratedWhite:0.0 alpha:0.9], YES);
         [image setTemplate:YES];
     }
     return image;

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to