Revision: 14396
http://sourceforge.net/p/skim-app/code/14396
Author: hofman
Date: 2024-07-25 15:59:38 +0000 (Thu, 25 Jul 2024)
Log Message:
-----------
Draw custom cursor images using system tint colors. Unfortunately we cannot
observe changes to these (private) colors.
Modified Paths:
--------------
trunk/NSCursor_SKExtensions.m
trunk/NSImage_SKExtensions.m
Modified: trunk/NSCursor_SKExtensions.m
===================================================================
--- trunk/NSCursor_SKExtensions.m 2024-07-23 16:29:41 UTC (rev 14395)
+++ trunk/NSCursor_SKExtensions.m 2024-07-25 15:59:38 UTC (rev 14396)
@@ -294,7 +294,7 @@
[laserPointerWindow setFrame:SKRectFromCenterAndSize(p,
[laserPointerWindow frame].size) display:YES];
} else {
NSImage *image = [self image];
- NSNumber *size = [[[NSUserDefaults standardUserDefaults]
persistentDomainForName:@"com.apple.universalaccess"]
objectForKey:@"mouseDriverCursorSize"];
+ NSNumber *size = [[[NSUserDefaults alloc]
initWithSuiteName:@"com.apple.universalaccess"]
objectForKey:@"mouseDriverCursorSize"];
CGFloat s = 2.0 * round(0.5 * (size ? [size doubleValue] : 1.0) *
[image size].width);
laserPointerWindow = [[SKAnimatedBorderlessWindow alloc]
initWithContentRect:SKRectFromCenterAndSquareSize(p, s)];
[laserPointerWindow setLevel:(NSWindowLevel)kCGCursorWindowLevel];
Modified: trunk/NSImage_SKExtensions.m
===================================================================
--- trunk/NSImage_SKExtensions.m 2024-07-23 16:29:41 UTC (rev 14395)
+++ trunk/NSImage_SKExtensions.m 2024-07-25 15:59:38 UTC (rev 14396)
@@ -258,8 +258,8 @@
macro(Ink)
#define DECLARE_NOTE_FUNCTIONS(name) \
-static void draw ## name ## Note(); \
-static void draw ## name ## NoteBackground()
+static void draw ## name ## Note(NSColor *oolor); \
+static void draw ## name ## NoteBackground(NSColor *color)
APPLY_NOTE_TYPES(DECLARE_NOTE_FUNCTIONS);
@@ -1043,18 +1043,18 @@
#define MAKE_BADGED_IMAGES(name) \
MAKE_IMAGE(SKImageNameToolbarAdd ## name ## Note, YES, 27.0, 19.0, \
translate(3.0, 0.0); \
- draw ## name ## Note(); \
+ draw ## name ## Note(nil); \
drawAddBadge(); \
); \
MAKE_IMAGE(SKImageNameToolbar ## name ## NoteMenu, YES, 27.0, 19.0, \
drawMenuBadge(); \
translate(1.0, 0.0); \
- draw ## name ## Note(); \
+ draw ## name ## Note(nil); \
); \
MAKE_IMAGE(SKImageNameToolbarAdd ## name ## NoteMenu, YES, 27.0, 19.0, \
drawMenuBadge(); \
translate(1.0, 0.0); \
- draw ## name ## Note(); \
+ draw ## name ## Note(nil); \
drawAddBadge(); \
); \
@@ -1342,11 +1342,11 @@
#define MAKE_NOTE_TOUCHBAR_IMAGES(name) \
MAKE_IMAGE(SKImageNameTouchBar ## name ## Note, YES, 26.0, 30.0, \
translate(1.5, 5.0); \
- draw ## name ## Note(); \
+ draw ## name ## Note(nil); \
); \
MAKE_IMAGE(SKImageNameTouchBarAdd ## name ## Note, YES, 28.0, 30.0, \
translate(1.5, 5.0); \
- draw ## name ## Note(); \
+ draw ## name ## Note(nil); \
translate(4.5, 0.0); \
drawAddBadge(); \
); \
@@ -1353,7 +1353,7 @@
MAKE_IMAGE(SKImageNameTouchBar ## name ## NotePopover, YES, 36.0, 30.0, \
drawPopoverBadge(); \
translate(5.5, 5.0); \
- draw ## name ## Note(); \
+ draw ## name ## Note(nil); \
);
APPLY_NOTE_TYPES(MAKE_NOTE_TOUCHBAR_IMAGES);
@@ -1403,7 +1403,7 @@
#define MAKE_NOTE_IMAGE(name) \
MAKE_IMAGE(SKImageName ## name ## Note, YES, 21.0, 19.0, \
- draw ## name ## Note(); \
+ draw ## name ## Note(nil); \
)
APPLY_NOTE_TYPES(MAKE_NOTE_IMAGE);
@@ -1412,7 +1412,7 @@
[[NSColor blackColor] setStroke];
[NSBezierPath strokeRect:NSMakeRect(1.5, 2.5, 16.0, 10.0)];
[[NSGraphicsContext currentContext]
setCompositingOperation:NSCompositingOperationCopy];
- drawTextNote();
+ drawTextNote(nil);
);
[[self imageNamed:SKImageNameTextNote]
setAccessibilityDescription:[SKNFreeTextString typeName]];
@@ -1542,12 +1542,12 @@
t = [NSAffineTransform transform];
[t translateXBy:1.5 yBy:3.0];
[t concat];
- drawTextNote();
+ drawTextNote(nil);
t = [NSAffineTransform transform];
[t rotateByDegrees:-45.0];
[t translateXBy:-4 yBy:-2];
[t concat];
- drawInkNote();
+ drawInkNote(nil);
);
}
@@ -1612,8 +1612,20 @@
+ (void)makeCursorImages {
+ NSUserDefaults *prefs = [[NSUserDefaults alloc]
initWithSuiteName:@"com.apple.universalaccess"];
+ NSColor *cursorOutline = [NSColor whiteColor];
+ NSColor *cursorFill = [NSColor blackColor];
+ if ([prefs boolForKey:@"cursorIsCustomized"]) {
+ NSDictionary *color = [prefs dictionaryForKey:@"cursorOutline"];
+ if ([color count] == 4)
+ cursorOutline = [NSColor colorWithSRGBRed:[[color
objectForKey:@"red"] doubleValue] green:[[color objectForKey:@"green"]
doubleValue] blue:[[color objectForKey:@"blue"] doubleValue] alpha:[[color
objectForKey:@"alpha"] doubleValue]] ?: cursorOutline;
+ color = [prefs dictionaryForKey:@"cursorFill"];
+ if ([color count] == 4)
+ cursorFill = [NSColor colorWithSRGBRed:[[color
objectForKey:@"red"] doubleValue] green:[[color objectForKey:@"green"]
doubleValue] blue:[[color objectForKey:@"blue"] doubleValue] alpha:[[color
objectForKey:@"alpha"] doubleValue]] ?: cursorFill;
+ }
+
MAKE_VECTOR_IMAGE(SKImageNameResizeDiagonal45Cursor, NO, 16.0, 16.0,
- [[NSColor whiteColor] setFill];
+ [cursorOutline setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(2.0, 2.0)];
[path lineToPoint:NSMakePoint(9.5, 2.0)];
@@ -1638,7 +1650,7 @@
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[path fill];
[NSGraphicsContext restoreGraphicsState];
- [[NSColor blackColor] setFill];
+ [cursorFill setFill];
path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(3.0, 3.0)];
[path lineToPoint:NSMakePoint(7.0, 3.0)];
@@ -1663,7 +1675,7 @@
);
MAKE_VECTOR_IMAGE(SKImageNameResizeDiagonal135Cursor, NO, 16.0, 16.0,
- [[NSColor whiteColor] setFill];
+ [cursorOutline setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(14.0, 2.0)];
[path lineToPoint:NSMakePoint(14.0, 9.5)];
@@ -1688,7 +1700,7 @@
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[path fill];
[NSGraphicsContext restoreGraphicsState];
- [[NSColor blackColor] setFill];
+ [cursorFill setFill];
path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(13.0, 3.0)];
[path lineToPoint:NSMakePoint(13.0, 7.0)];
@@ -1713,7 +1725,7 @@
);
MAKE_VECTOR_IMAGE(SKImageNameZoomInCursor, NO, 18.0, 18.0,
- [[NSColor whiteColor] set];
+ [cursorOutline set];
NSBezierPath *path = [NSBezierPath
bezierPathWithOvalInRect:NSMakeRect(1.0, 5.0, 13.0, 13.0)];
[path moveToPoint:NSMakePoint(14.5, 1.5)];
[path lineToPoint:NSMakePoint(17.5, 4.5)];
@@ -1724,7 +1736,7 @@
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[path fill];
[NSGraphicsContext restoreGraphicsState];
- [[NSColor blackColor] setStroke];
+ [cursorFill setStroke];
path = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(3.0, 7.0,
9.0, 9.0)];
[path setLineWidth:2.0];
[path stroke];
@@ -1743,7 +1755,7 @@
);
MAKE_VECTOR_IMAGE(SKImageNameZoomOutCursor, NO, 18.0, 18.0,
- [[NSColor whiteColor] set];
+ [cursorOutline set];
NSBezierPath *path = [NSBezierPath
bezierPathWithOvalInRect:NSMakeRect(1.0, 5.0, 13.0, 13.0)];
[path moveToPoint:NSMakePoint(14.5, 1.5)];
[path lineToPoint:NSMakePoint(17.5, 4.5)];
@@ -1754,7 +1766,7 @@
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[path fill];
[NSGraphicsContext restoreGraphicsState];
- [[NSColor blackColor] setStroke];
+ [cursorFill setStroke];
path = [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(3.0, 7.0,
9.0, 9.0)];
[path setLineWidth:2.0];
[path stroke];
@@ -1771,7 +1783,7 @@
);
MAKE_VECTOR_IMAGE(SKImageNameCameraCursor, NO, 18.0, 16.0,
- [[NSColor whiteColor] set];
+ [cursorOutline set];
NSBezierPath *path = [NSBezierPath bezierPathWithRect:NSMakeRect(1.0,
2.0, 16.0, 11.0)];
[path appendBezierPathWithOvalInRect:NSMakeRect(4.7, 6.7, 8.6, 8.6)];
[NSGraphicsContext saveGraphicsState];
@@ -1778,11 +1790,11 @@
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[path fill];
[NSGraphicsContext restoreGraphicsState];
- [[NSColor blackColor] set];
+ [cursorFill set];
path = [NSBezierPath bezierPathWithRect:NSMakeRect(2.0, 3.0, 14.0,
9.0)];
[path appendBezierPathWithOvalInRect:NSMakeRect(6.0, 8.0, 6.0, 6.0)];
[path fill];
- [[NSColor whiteColor] set];
+ [cursorOutline set];
[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(5.3, 4.3, 7.4,
7.4)] stroke];
path = [NSBezierPath bezierPath];
[path appendBezierPathWithArcWithCenter:NSMakePoint(9.0, 8.0)
radius:1.8 startAngle:45.0 endAngle:225.0];
@@ -1795,7 +1807,7 @@
if (NSEqualSizes(size, NSMakeSize(32.0, 32.0))) {
MAKE_VECTOR_IMAGE(SKImageNameOpenHandBarCursor, NO, 32.0, 32.0,
- [[NSColor blackColor] setFill];
+ [cursorFill setFill];
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[NSBezierPath fillRect:NSMakeRect(2.0, 14.0, 28.0, 4.0)];
@@ -1804,7 +1816,7 @@
);
MAKE_VECTOR_IMAGE(SKImageNameClosedHandBarCursor, NO, 32.0, 32.0,
- [[NSColor blackColor] setFill];
+ [cursorFill setFill];
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:1.0
yOffset:-1.0];
[NSBezierPath fillRect:NSMakeRect(2.0, 14.0, 28.0, 4.0)];
@@ -1815,13 +1827,13 @@
} else {
MAKE_VECTOR_IMAGE(SKImageNameOpenHandBarCursor, NO, size.width, size.width,
- [[NSColor blackColor] setFill];
+ [cursorFill setFill];
[NSBezierPath fillRect:NSMakeRect(0.0, 9.0 / 16.0 * size.height,
size.width, 3.0 / 16.0 * size.height)];
[[[NSCursor openHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
size.width, size.height) fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver fraction:1.0];
);
MAKE_VECTOR_IMAGE(SKImageNameClosedHandBarCursor, NO, size.width,
size.width,
- [[NSColor blackColor] setFill];
+ [cursorFill setFill];
[NSBezierPath fillRect:NSMakeRect(0.0, 6.0 / 16.0 * size.height,
size.width, 3.0 / 16.0 * size.height)];
[[[NSCursor closedHandCursor] image] drawInRect:NSMakeRect(0.0, 0.0,
size.width, size.height) fromRect:NSZeroRect
operation:NSCompositingOperationSourceOver fraction:1.0];
);
@@ -1832,8 +1844,8 @@
MAKE_VECTOR_IMAGE(SKImageName ## name ## NoteCursor, NO, 24.0, 42.0, \
drawArrowCursor(); \
translate(2.0, 2.0); \
- draw ## name ## NoteBackground(); \
- draw ## name ## Note(); \
+ draw ## name ## NoteBackground(cursorOutline); \
+ draw ## name ## Note(cursorFill); \
)
APPLY_NOTE_TYPES(MAKE_NOTE_CURSOR_IMAGE);
@@ -1940,8 +1952,8 @@
@end
-static void drawTextNote() {
- [[NSColor colorWithGenericGamma22White:0.0 alpha:0.75] setFill];
+static void drawTextNote(NSColor *color) {
+ [[color colorWithAlphaComponent:0.75] ?: [NSColor
colorWithGenericGamma22White:0.0 alpha:0.75] setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(5.0, 5.0)];
[path lineToPoint:NSMakePoint(9.0, 6.5)];
@@ -1955,8 +1967,8 @@
[path fill];
}
-static void drawAnchoredNote() {
- [[NSColor blackColor] setStroke];
+static void drawAnchoredNote(NSColor *color) {
+ [color ?: [NSColor blackColor] setStroke];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(12.0, 6.5)];
[path appendBezierPathWithArcFromPoint:NSMakePoint(16.5, 6.5)
toPoint:NSMakePoint(16.5, 15.5) radius:4.5];
@@ -1965,7 +1977,7 @@
[path lineToPoint:NSMakePoint(8.5, 4.5)];
[path closePath];
[path stroke];
- [[NSColor colorWithGenericGamma22White:0.0 alpha:0.333] setStroke];
+ [[color colorWithAlphaComponent:0.333] ?: [NSColor
colorWithGenericGamma22White:0.0 alpha:0.333] setStroke];
path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(8.0, 11.5)];
[path lineToPoint:NSMakePoint(12.0, 11.5)];
@@ -1974,25 +1986,25 @@
[path stroke];
}
-static void drawCircleNote() {
- [[NSColor blackColor] setStroke];
+static void drawCircleNote(NSColor *color) {
+ [color ?: [NSColor blackColor] setStroke];
NSBezierPath *path = [NSBezierPath
bezierPathWithOvalInRect:NSMakeRect(4.5, 4.5, 12.0, 11.0)];
[path stroke];
}
-static void drawSquareNote() {
- [[NSColor blackColor] setStroke];
+static void drawSquareNote(NSColor *color) {
+ [color ?: [NSColor blackColor] setStroke];
NSBezierPath *path = [NSBezierPath bezierPathWithRect:NSMakeRect(4.5, 4.5,
12.0, 11.0)];
[path stroke];
}
-static void drawHighlightNote() {
+static void drawHighlightNote(NSColor *color) {
NSFont *font = [NSFont fontWithName:@"Helvetica" size:14.0] ?: [NSFont
systemFontOfSize:14.0];
NSGlyph glyph = [font glyphWithName:@"H"];
- [[NSColor colorWithGenericGamma22White:0.0 alpha:0.25] setFill];
+ [[color colorWithAlphaComponent:0.25] ?: [NSColor
colorWithGenericGamma22White:0.0 alpha:0.25] setFill];
NSBezierPath *path = [NSBezierPath bezierPathWithRect:NSMakeRect(3.0, 2.0,
15.0, 16.0)];
[path fill];
- [[NSColor colorWithGenericGamma22White:0.0 alpha:0.75] setFill];
+ [[color colorWithAlphaComponent:0.75] ?: [NSColor
colorWithGenericGamma22White:0.0 alpha:0.75] setFill];
path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(10.5 - NSMidX([font
boundingRectForGlyph:glyph]), 5.0)];
[path appendBezierPathWithGlyph:glyph inFont:font];
@@ -1999,15 +2011,15 @@
[path fill];
}
-static void drawUnderlineNote() {
+static void drawUnderlineNote(NSColor *color) {
NSFont *font = [NSFont fontWithName:@"Helvetica" size:14.0] ?: [NSFont
systemFontOfSize:14.0];
NSGlyph glyph = [font glyphWithName:@"U"];
- [[NSColor colorWithGenericGamma22White:0.0 alpha:0.75] setFill];
+ [[color colorWithAlphaComponent:0.75] ?: [NSColor
colorWithGenericGamma22White:0.0 alpha:0.75] setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(10.5 - NSMidX([font
boundingRectForGlyph:glyph]), 6.0)];
[path appendBezierPathWithGlyph:glyph inFont:font];
[path fill];
- [[NSColor blackColor] setStroke];
+ [color ?: [NSColor blackColor] setStroke];
path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(2.0, 4.5)];
[path lineToPoint:NSMakePoint(19.0, 4.5)];
@@ -2014,15 +2026,15 @@
[path stroke];
}
-static void drawStrikeOutNote() {
+static void drawStrikeOutNote(NSColor *color) {
NSFont *font = [NSFont fontWithName:@"Helvetica" size:14.0] ?: [NSFont
systemFontOfSize:14.0];
NSGlyph glyph = [font glyphWithName:@"S"];
- [[NSColor colorWithGenericGamma22White:0.0 alpha:0.75] setFill];
+ [[color colorWithAlphaComponent:0.75] ?: [NSColor
colorWithGenericGamma22White:0.0 alpha:0.75] setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(10.5 - NSMidX([font
boundingRectForGlyph:glyph]), 5.0)];
[path appendBezierPathWithGlyph:glyph inFont:font];
[path fill];
- [[NSColor blackColor] setStroke];
+ [color ?: [NSColor blackColor] setStroke];
path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(2.0, 9.5)];
[path lineToPoint:NSMakePoint(19.0, 9.5)];
@@ -2029,8 +2041,8 @@
[path stroke];
}
-static void drawLineNote() {
- [[NSColor blackColor] setFill];
+static void drawLineNote(NSColor *color) {
+ [color ?: [NSColor blackColor] setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(3.0, 10.0)];
[path lineToPoint:NSMakePoint(15.0, 10.0)];
@@ -2043,8 +2055,8 @@
[path fill];
}
-static void drawInkNote() {
- [[NSColor blackColor] setStroke];
+static void drawInkNote(NSColor *color) {
+ [color ?: [NSColor blackColor] setStroke];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(4.0, 9.0)];
[path curveToPoint:NSMakePoint(10.5, 10.0) controlPoint1:NSMakePoint(10.0,
5.0) controlPoint2:NSMakePoint(13.0, 5.0)];
@@ -2052,10 +2064,10 @@
[path stroke];
}
-static void drawTextNoteBackground() {
+static void drawTextNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setFill];
+ [color setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(3.22, 3.22)];
[path lineToPoint:NSMakePoint(10.1, 5.7)];
@@ -2067,10 +2079,10 @@
[NSGraphicsContext restoreGraphicsState];
}
-static void drawAnchoredNoteBackground() {
+static void drawAnchoredNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setFill];
+ [color setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(12.15, 5.0)];
[path appendBezierPathWithArcFromPoint:NSMakePoint(18.0, 5.0)
toPoint:NSMakePoint(18.0, 15.5) radius:6.0];
@@ -2082,10 +2094,10 @@
[NSGraphicsContext restoreGraphicsState];
}
-static void drawCircleNoteBackground() {
+static void drawCircleNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setStroke];
+ [color setStroke];
NSBezierPath *path = [NSBezierPath
bezierPathWithOvalInRect:NSMakeRect(4.5, 4.5, 12.0, 11.0)];
[path setLineWidth:3.0];
[path stroke];
@@ -2092,10 +2104,10 @@
[NSGraphicsContext restoreGraphicsState];
}
-static void drawSquareNoteBackground() {
+static void drawSquareNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setStroke];
+ [color setStroke];
NSBezierPath *path = [NSBezierPath bezierPathWithRect:NSMakeRect(4.5, 4.5,
12.0, 11.0)];
[path setLineWidth:3.0];
[path stroke];
@@ -2102,19 +2114,19 @@
[NSGraphicsContext restoreGraphicsState];
}
-static void drawHighlightNoteBackground() {
+static void drawHighlightNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setFill];
+ [color setFill];
NSBezierPath *path = [NSBezierPath bezierPathWithRect:NSMakeRect(2.0, 1.0,
17.0, 18.0)];
[path fill];
[NSGraphicsContext restoreGraphicsState];
}
-static void drawUnderlineNoteBackground() {
+static void drawUnderlineNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setStroke];
+ [color setStroke];
NSFont *font = [NSFont fontWithName:@"Helvetica" size:14.0] ?: [NSFont
systemFontOfSize:14.0];
NSGlyph glyph = [font glyphWithName:@"U"];
NSBezierPath *path = [NSBezierPath bezierPath];
@@ -2126,10 +2138,10 @@
[NSGraphicsContext restoreGraphicsState];
}
-static void drawStrikeOutNoteBackground() {
+static void drawStrikeOutNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setStroke];
+ [color setStroke];
NSFont *font = [NSFont fontWithName:@"Helvetica" size:14.0] ?: [NSFont
systemFontOfSize:14.0];
NSGlyph glyph = [font glyphWithName:@"S"];
NSBezierPath *path = [NSBezierPath bezierPath];
@@ -2141,10 +2153,10 @@
[NSGraphicsContext restoreGraphicsState];
}
-static void drawLineNoteBackground() {
+static void drawLineNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setFill];
+ [color setFill];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(2.0, 9.0)];
[path lineToPoint:NSMakePoint(14.0, 9.0)];
@@ -2158,10 +2170,10 @@
[NSGraphicsContext restoreGraphicsState];
}
-static void drawInkNoteBackground() {
+static void drawInkNoteBackground(NSColor *color) {
[NSGraphicsContext saveGraphicsState];
[NSShadow setShadowWithWhite:0.0 alpha:0.33333 blurRadius:2.0
yOffset:-1.0];
- [[NSColor whiteColor] setStroke];
+ [color setStroke];
NSBezierPath *path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(3.24, 9.52)];
[path lineToPoint:NSMakePoint(4.0, 9.0)];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit