node-mac-recorder 2.20.15 → 2.20.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/window_selector.mm +17 -8
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -58,7 +58,10 @@ static NSInteger g_currentActiveScreenIndex = -1;
|
|
|
58
58
|
|
|
59
59
|
// Record icon helpers
|
|
60
60
|
static NSImage *CreateRecordIconImage(CGFloat size) {
|
|
61
|
-
|
|
61
|
+
const CGFloat leadingInset = 8.0;
|
|
62
|
+
const CGFloat trailingSpacing = 6.0;
|
|
63
|
+
CGFloat width = leadingInset + size + trailingSpacing;
|
|
64
|
+
NSImage *image = [[[NSImage alloc] initWithSize:NSMakeSize(width, size)] autorelease];
|
|
62
65
|
if (!image) {
|
|
63
66
|
return nil;
|
|
64
67
|
}
|
|
@@ -66,21 +69,22 @@ static NSImage *CreateRecordIconImage(CGFloat size) {
|
|
|
66
69
|
[image lockFocus];
|
|
67
70
|
|
|
68
71
|
[[NSColor clearColor] setFill];
|
|
69
|
-
NSRectFill(NSMakeRect(0, 0,
|
|
72
|
+
NSRectFill(NSMakeRect(0, 0, width, size));
|
|
70
73
|
|
|
71
74
|
CGFloat strokeWidth = MAX(2.0, size * 0.12);
|
|
72
|
-
NSRect
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
NSRect iconRect = NSMakeRect(leadingInset,
|
|
76
|
+
(size - size) / 2.0,
|
|
77
|
+
size,
|
|
78
|
+
size);
|
|
79
|
+
NSRect outerRect = NSInsetRect(iconRect, strokeWidth / 2.0, strokeWidth / 2.0);
|
|
76
80
|
NSBezierPath *outerPath = [NSBezierPath bezierPathWithOvalInRect:outerRect];
|
|
77
81
|
[outerPath setLineWidth:strokeWidth];
|
|
78
82
|
[[NSColor whiteColor] setStroke];
|
|
79
83
|
[outerPath stroke];
|
|
80
84
|
|
|
81
85
|
CGFloat innerDiameter = size * 0.45;
|
|
82
|
-
NSRect innerRect = NSMakeRect((
|
|
83
|
-
(
|
|
86
|
+
NSRect innerRect = NSMakeRect(NSMidX(iconRect) - innerDiameter / 2.0,
|
|
87
|
+
NSMidY(iconRect) - innerDiameter / 2.0,
|
|
84
88
|
innerDiameter,
|
|
85
89
|
innerDiameter);
|
|
86
90
|
NSBezierPath *innerPath = [NSBezierPath bezierPathWithOvalInRect:innerRect];
|
|
@@ -115,6 +119,11 @@ static void ApplyStartRecordButtonIcon(NSButton *button) {
|
|
|
115
119
|
[button setImageScaling:NSImageScaleNone];
|
|
116
120
|
[button setImagePosition:NSImageLeft];
|
|
117
121
|
|
|
122
|
+
if ([button respondsToSelector:@selector(setContentInsets:)]) {
|
|
123
|
+
NSEdgeInsets insets = NSEdgeInsetsMake(0, 12.0, 0, 12.0);
|
|
124
|
+
[button setContentInsets:insets];
|
|
125
|
+
}
|
|
126
|
+
|
|
118
127
|
if ([button respondsToSelector:@selector(setContentTintColor:)]) {
|
|
119
128
|
[button setContentTintColor:[NSColor whiteColor]];
|
|
120
129
|
}
|