Revision: 27322
http://sourceforge.net/p/bibdesk/svn/27322
Author: hofman
Date: 2022-03-25 18:48:23 +0000 (Fri, 25 Mar 2022)
Log Message:
-----------
larger table header images on 11.0+
Modified Paths:
--------------
trunk/bibdesk/BDSKMainTableView.m
Modified: trunk/bibdesk/BDSKMainTableView.m
===================================================================
--- trunk/bibdesk/BDSKMainTableView.m 2022-03-25 06:30:25 UTC (rev 27321)
+++ trunk/bibdesk/BDSKMainTableView.m 2022-03-25 18:48:23 UTC (rev 27322)
@@ -398,11 +398,13 @@
static NSDictionary *headerImageCache = nil;
if (headerImageCache == nil) {
- NSSize size = NSMakeSize(13.0, 13.0);
-
+ CGFloat width = RUNNING_AFTER(10_15) ? 16.0 : 13.0;
+ NSSize size = NSMakeSize(width, width);
+ CGFloat x = (width - 1.0) / 3.0;
+
NSAffineTransform *t = [NSAffineTransform transform];
[t rotateByDegrees:-45.0];
- [t scaleBy:13.0 / 16.0];
+ [t scaleBy:width / 16.0];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(3.0, 15.0)];
[path appendBezierPathWithArcWithCenter:NSMakePoint(0.0, 6.0)
radius:3.0 startAngle:0.0 endAngle:180.0 clockwise:YES];
@@ -429,13 +431,13 @@
[crossref setTemplate:YES];
path = [NSBezierPath bezierPath];
- [path moveToPoint:NSMakePoint(3.0, 13.0)];
- [path lineToPoint:NSMakePoint(10.0, 13.0)];
- [path lineToPoint:NSMakePoint(10.0, 7.0)];
- [path lineToPoint:NSMakePoint(13.0, 7.0)];
- [path lineToPoint:NSMakePoint(6.5, 0.5)];
- [path lineToPoint:NSMakePoint(0.0, 7.0)];
- [path lineToPoint:NSMakePoint(3.0, 7.0)];
+ [path moveToPoint:NSMakePoint(x - 1.0, width)];
+ [path lineToPoint:NSMakePoint(width - x + 1.0, width)];
+ [path lineToPoint:NSMakePoint(width - x + 1.0, 0.5 * width + 0.5)];
+ [path lineToPoint:NSMakePoint(width, 0.5 * width + 0.5)];
+ [path lineToPoint:NSMakePoint(0.5 * width, 0.5)];
+ [path lineToPoint:NSMakePoint(0.0, 0.5 * width + 0.5)];
+ [path lineToPoint:NSMakePoint(x - 1.0, 0.5 * width + 0.5)];
[path closePath];
NSImage *import = [[[NSImage alloc] initBitmapWithSize:size
drawingHandler:^(NSRect rect){
[path fill];
@@ -444,15 +446,15 @@
path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(2.5, 2.5)];
- [path appendBezierPathWithArcFromPoint:NSMakePoint(2.5, 1.5)
toPoint:NSMakePoint(10.5, 1.5) radius:1.0];
- [path appendBezierPathWithArcFromPoint:NSMakePoint(10.5, 1.5)
toPoint:NSMakePoint(10.5, 9.0) radius:1.0];
- [path lineToPoint:NSMakePoint(10.5, 9.0)];
- [path lineToPoint:NSMakePoint(8.0, 11.5)];
- [path appendBezierPathWithArcFromPoint:NSMakePoint(2.5, 11.5)
toPoint:NSMakePoint(2.5, 1.5) radius:1.0];
+ [path appendBezierPathWithArcFromPoint:NSMakePoint(2.5, 1.5)
toPoint:NSMakePoint(width - 2.5, 1.5) radius:1.0];
+ [path appendBezierPathWithArcFromPoint:NSMakePoint(width - 2.5, 1.5)
toPoint:NSMakePoint(width - 2.5, 2.0 * x + 0.5) radius:1.0];
+ [path lineToPoint:NSMakePoint(width - 2.5, 2.0 * x + 0.5)];
+ [path lineToPoint:NSMakePoint(width - 6.0, width - 1.5)];
+ [path appendBezierPathWithArcFromPoint:NSMakePoint(2.5, width - 1.5)
toPoint:NSMakePoint(2.5, 1.5) radius:1.0];
[path closePath];
- [path moveToPoint:NSMakePoint(10.5, 8.5)];
- [path appendBezierPathWithArcFromPoint:NSMakePoint(7.5, 8.5)
toPoint:NSMakePoint(7.5, 11.5) radius:1.0];
- [path lineToPoint:NSMakePoint(7.5, 11.5)];
+ [path moveToPoint:NSMakePoint(width - 2.5, 2.0 * x)];
+ [path appendBezierPathWithArcFromPoint:NSMakePoint(width - 6.5, 2.0 *
x) toPoint:NSMakePoint(2.0 * x - 6.0, width - 1.5) radius:1.0];
+ [path lineToPoint:NSMakePoint(width - 6.5, width - 1.5)];
NSImage *file = [[[NSImage alloc] initBitmapWithSize:size
drawingHandler:^(NSRect rect){
[path stroke];
}] autorelease];
@@ -460,30 +462,30 @@
NSImage *doi = [[[NSImage alloc] initBitmapWithSize:size
drawingHandler:^(NSRect rect){
[[NSColor colorWithSRGBRed:1.0 green:0.7 blue:0.0 alpha:1.0]
setFill];
- [NSBezierPath setDefaultLineWidth:1.2];
- [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(0, 0, 13, 13)]
fill];
- NSBezierPath *p = [NSBezierPath
bezierPathWithOvalInRect:NSMakeRect(1.5, 5.0, 3.0, 3.0)];
- [p moveToPoint:NSMakePoint(4.5, 4.5)];
- [p lineToPoint:NSMakePoint(4.5, 10.5)];
+ [NSBezierPath setDefaultLineWidth:0.3 * x];
+ [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(0, 0, width,
width)] fill];
+ NSBezierPath *p = [NSBezierPath
bezierPathWithOvalInRect:NSMakeRect(1.5, x + 1.0, 0.5 * x + 1.0, 0.5 * x +
1.0)];
+ [p moveToPoint:NSMakePoint(x + 0.5, x + 0.5)];
+ [p lineToPoint:NSMakePoint(x + 0.5, width - 0.5 * x - 0.5)];
[[NSColor blackColor] setStroke];
[p stroke];
- p = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(6.0, 5.0,
3.0, 3.0)];
- [p moveToPoint:NSMakePoint(10.5, 4.5)];
- [p lineToPoint:NSMakePoint(10.5, 8.5)];
+ p = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(1.5 * x, x +
1.0, 0.5 * x + 1.0, 0.5 * x + 1.0)];
+ [p moveToPoint:NSMakePoint(width - 0.5 * x - 0.5, x + 0.5)];
+ [p lineToPoint:NSMakePoint(width - 0.5 * x - 0.5, width - x -
0.5)];
[[NSColor whiteColor] set];
[p stroke];
- p = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(9.75, 8.75,
1.5, 1.5)];
+ p = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(width - 0.75
* x - 0.25, width - 0.75 * x - 1.25, 0.5 * x - 0.5, 0.5 * x - 0.5)];
[p fill];
[NSBezierPath setDefaultLineWidth:1.0];
}] autorelease];
- NSDictionary *attrs = [NSDictionary
dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"Helvetica" size:5.0],
NSFontAttributeName, [NSColor colorWithSRGBRed:0.0 green:0.471 blue:0.643
alpha:1.0], NSForegroundColorAttributeName, nil];
+ NSDictionary *attrs = [NSDictionary
dictionaryWithObjectsAndKeys:[NSFont fontWithName:@"Helvetica" size:x + 1.0],
NSFontAttributeName, [NSColor colorWithSRGBRed:0.0 green:0.471 blue:0.643
alpha:1.0], NSForegroundColorAttributeName, nil];
NSArray *strings = [NSArray arrayWithObjects:@"Cite", @"Seer", @"X",
nil];
NSImage *citeseer = [[[NSImage alloc] initBitmapWithSize:size
drawingHandler:^(NSRect rect){
- NSRect r = NSMakeRect(1.0, 9.0, 13.0, 5.0);
+ NSRect r = NSMakeRect(1.0, width - x, width, x + 1.0);
for (NSString *string in strings) {
[[[[NSAttributedString alloc] initWithString:string
attributes:attrs] autorelease] drawInRect:r];
- r.origin.y -= 4.0;
+ r.origin.y -= x;
}
}] autorelease];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit