node-mac-recorder 2.5.3 → 2.5.4
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 +72 -70
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
#import <ApplicationServices/ApplicationServices.h>
|
|
6
6
|
#import <Carbon/Carbon.h>
|
|
7
7
|
#import <Accessibility/Accessibility.h>
|
|
8
|
+
#import <QuartzCore/QuartzCore.h>
|
|
8
9
|
|
|
9
10
|
// Global state for window selection
|
|
10
11
|
static bool g_isWindowSelecting = false;
|
|
@@ -67,16 +68,10 @@ bool hideScreenRecordingPreview();
|
|
|
67
68
|
|
|
68
69
|
if (!self.windowInfo) return;
|
|
69
70
|
|
|
70
|
-
// Background with transparency - purple tone
|
|
71
|
-
[[NSColor colorWithRed:0.
|
|
71
|
+
// Background with transparency - purple tone (no border)
|
|
72
|
+
[[NSColor colorWithRed:0.5 green:0.3 blue:0.8 alpha:0.25] setFill];
|
|
72
73
|
NSRectFill(self.bounds);
|
|
73
74
|
|
|
74
|
-
// Ultra-thin border with darker purple
|
|
75
|
-
[[NSColor colorWithRed:0.5 green:0.3 blue:0.7 alpha:0.4] setStroke];
|
|
76
|
-
NSBezierPath *border = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect(self.bounds, 0.125, 0.125) xRadius:12 yRadius:12];
|
|
77
|
-
[border setLineWidth:0.25];
|
|
78
|
-
[border stroke];
|
|
79
|
-
|
|
80
75
|
// Text will be handled by separate label above button
|
|
81
76
|
}
|
|
82
77
|
|
|
@@ -155,16 +150,10 @@ bool hideScreenRecordingPreview();
|
|
|
155
150
|
|
|
156
151
|
if (!self.screenInfo) return;
|
|
157
152
|
|
|
158
|
-
// Background with transparency - purple tone
|
|
159
|
-
[[NSColor colorWithRed:0.
|
|
153
|
+
// Background with transparency - purple tone (no border)
|
|
154
|
+
[[NSColor colorWithRed:0.5 green:0.3 blue:0.8 alpha:0.3] setFill];
|
|
160
155
|
NSRectFill(self.bounds);
|
|
161
156
|
|
|
162
|
-
// Ultra-thin border with darker purple
|
|
163
|
-
[[NSColor colorWithRed:0.5 green:0.3 blue:0.7 alpha:0.3] setStroke];
|
|
164
|
-
NSBezierPath *border = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect(self.bounds, 0.125, 0.125) xRadius:15 yRadius:15];
|
|
165
|
-
[border setLineWidth:0.25];
|
|
166
|
-
[border stroke];
|
|
167
|
-
|
|
168
157
|
// Text will be handled by separate label above button
|
|
169
158
|
}
|
|
170
159
|
|
|
@@ -577,6 +566,30 @@ void updateOverlay() {
|
|
|
577
566
|
NSLog(@"🎯 Positioning app icon at: (%.0f, %.0f) for window size: (%.0f, %.0f)",
|
|
578
567
|
iconCenter.x, iconCenter.y, (float)width, (float)height);
|
|
579
568
|
|
|
569
|
+
// Add smooth floating animation after positioning
|
|
570
|
+
[appIconView.layer removeAnimationForKey:@"floatAnimation"];
|
|
571
|
+
[appIconView.layer removeAnimationForKey:@"floatAnimationY"];
|
|
572
|
+
|
|
573
|
+
// Horizontal float animation
|
|
574
|
+
CABasicAnimation *floatAnimationX = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
|
|
575
|
+
floatAnimationX.fromValue = @(-5.0);
|
|
576
|
+
floatAnimationX.toValue = @(5.0);
|
|
577
|
+
floatAnimationX.duration = 3.5;
|
|
578
|
+
floatAnimationX.repeatCount = HUGE_VALF;
|
|
579
|
+
floatAnimationX.autoreverses = YES;
|
|
580
|
+
floatAnimationX.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
|
581
|
+
[appIconView.layer addAnimation:floatAnimationX forKey:@"floatAnimationX"];
|
|
582
|
+
|
|
583
|
+
// Subtle vertical float animation (slightly offset timing)
|
|
584
|
+
CABasicAnimation *floatAnimationY = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
|
|
585
|
+
floatAnimationY.fromValue = @(-2.0);
|
|
586
|
+
floatAnimationY.toValue = @(2.0);
|
|
587
|
+
floatAnimationY.duration = 4.5;
|
|
588
|
+
floatAnimationY.repeatCount = HUGE_VALF;
|
|
589
|
+
floatAnimationY.autoreverses = YES;
|
|
590
|
+
floatAnimationY.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
|
591
|
+
[appIconView.layer addAnimation:floatAnimationY forKey:@"floatAnimationY"];
|
|
592
|
+
|
|
580
593
|
// Position info label at overlay center, above button
|
|
581
594
|
NSPoint labelCenter = NSMakePoint(
|
|
582
595
|
(width - [infoLabel frame].size.width) / 2, // Center horizontally
|
|
@@ -821,22 +834,23 @@ bool startScreenSelection() {
|
|
|
821
834
|
[overlayView setScreenInfo:screenInfo];
|
|
822
835
|
[overlayWindow setContentView:overlayView];
|
|
823
836
|
|
|
824
|
-
// Create select button
|
|
825
|
-
NSButton *selectButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0,
|
|
837
|
+
// Create select button with more padding
|
|
838
|
+
NSButton *selectButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
|
|
826
839
|
[selectButton setTitle:@"Start Record"];
|
|
827
840
|
[selectButton setButtonType:NSButtonTypeMomentaryPushIn];
|
|
828
841
|
[selectButton setBezelStyle:NSBezelStyleRegularSquare];
|
|
829
|
-
[selectButton setFont:[NSFont systemFontOfSize:16 weight:
|
|
842
|
+
[selectButton setFont:[NSFont systemFontOfSize:16 weight:NSFontWeightRegular]];
|
|
830
843
|
[selectButton setTag:i]; // Set screen index as tag
|
|
831
844
|
|
|
832
|
-
// Modern button styling with purple
|
|
845
|
+
// Modern button styling with purple tone
|
|
833
846
|
[selectButton setWantsLayer:YES];
|
|
834
|
-
[selectButton.layer setBackgroundColor:[[NSColor colorWithRed:0.
|
|
847
|
+
[selectButton.layer setBackgroundColor:[[NSColor colorWithRed:0.55 green:0.3 blue:0.75 alpha:0.95] CGColor]];
|
|
835
848
|
[selectButton.layer setCornerRadius:14.0];
|
|
836
849
|
[selectButton.layer setBorderWidth:0.0];
|
|
837
850
|
|
|
838
|
-
//
|
|
839
|
-
[selectButton setFont:[NSFont systemFontOfSize:
|
|
851
|
+
// Clean white text - normal weight
|
|
852
|
+
[selectButton setFont:[NSFont systemFontOfSize:16 weight:NSFontWeightRegular]];
|
|
853
|
+
[selectButton setTitle:@"Start Record"];
|
|
840
854
|
NSMutableAttributedString *titleString = [[NSMutableAttributedString alloc]
|
|
841
855
|
initWithString:[selectButton title]];
|
|
842
856
|
[titleString addAttribute:NSForegroundColorAttributeName
|
|
@@ -844,19 +858,7 @@ bool startScreenSelection() {
|
|
|
844
858
|
range:NSMakeRange(0, [titleString length])];
|
|
845
859
|
[selectButton setAttributedTitle:titleString];
|
|
846
860
|
|
|
847
|
-
//
|
|
848
|
-
[selectButton.layer setShadowColor:[[NSColor colorWithRed:0.4 green:0.2 blue:0.6 alpha:0.8] CGColor]];
|
|
849
|
-
[selectButton.layer setShadowOffset:NSMakeSize(0, -3)];
|
|
850
|
-
[selectButton.layer setShadowRadius:8.0];
|
|
851
|
-
[selectButton.layer setShadowOpacity:0.4];
|
|
852
|
-
|
|
853
|
-
// Add subtle inner highlight - purple tone
|
|
854
|
-
CALayer *highlightLayer = [CALayer layer];
|
|
855
|
-
[highlightLayer setFrame:CGRectMake(0, selectButton.frame.size.height * 0.6,
|
|
856
|
-
selectButton.frame.size.width, selectButton.frame.size.height * 0.4)];
|
|
857
|
-
[highlightLayer setBackgroundColor:[[NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.3] CGColor]];
|
|
858
|
-
[highlightLayer setCornerRadius:14.0];
|
|
859
|
-
[selectButton.layer addSublayer:highlightLayer];
|
|
861
|
+
// Clean button - no shadows or highlights
|
|
860
862
|
|
|
861
863
|
// Set button target and action (reuse global delegate)
|
|
862
864
|
if (!g_delegate) {
|
|
@@ -872,14 +874,14 @@ bool startScreenSelection() {
|
|
|
872
874
|
[screenCancelButton setBezelStyle:NSBezelStyleRegularSquare];
|
|
873
875
|
[screenCancelButton setFont:[NSFont systemFontOfSize:14 weight:NSFontWeightMedium]];
|
|
874
876
|
|
|
875
|
-
// Modern cancel button styling
|
|
877
|
+
// Modern cancel button styling - darker gray, clean
|
|
876
878
|
[screenCancelButton setWantsLayer:YES];
|
|
877
|
-
[screenCancelButton.layer setBackgroundColor:[[NSColor colorWithRed:0.
|
|
879
|
+
[screenCancelButton.layer setBackgroundColor:[[NSColor colorWithRed:0.35 green:0.35 blue:0.4 alpha:0.9] CGColor]];
|
|
878
880
|
[screenCancelButton.layer setCornerRadius:12.0];
|
|
879
881
|
[screenCancelButton.layer setBorderWidth:0.0];
|
|
880
882
|
|
|
881
|
-
//
|
|
882
|
-
[screenCancelButton setFont:[NSFont systemFontOfSize:15 weight:
|
|
883
|
+
// Clean white text for cancel button
|
|
884
|
+
[screenCancelButton setFont:[NSFont systemFontOfSize:15 weight:NSFontWeightRegular]];
|
|
883
885
|
NSMutableAttributedString *screenCancelTitleString = [[NSMutableAttributedString alloc]
|
|
884
886
|
initWithString:[screenCancelButton title]];
|
|
885
887
|
[screenCancelTitleString addAttribute:NSForegroundColorAttributeName
|
|
@@ -887,12 +889,6 @@ bool startScreenSelection() {
|
|
|
887
889
|
range:NSMakeRange(0, [screenCancelTitleString length])];
|
|
888
890
|
[screenCancelButton setAttributedTitle:screenCancelTitleString];
|
|
889
891
|
|
|
890
|
-
// Enhanced shadow for cancel button
|
|
891
|
-
[screenCancelButton.layer setShadowColor:[[NSColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:0.8] CGColor]];
|
|
892
|
-
[screenCancelButton.layer setShadowOffset:NSMakeSize(0, -2)];
|
|
893
|
-
[screenCancelButton.layer setShadowRadius:4.0];
|
|
894
|
-
[screenCancelButton.layer setShadowOpacity:0.3];
|
|
895
|
-
|
|
896
892
|
[screenCancelButton setTarget:g_delegate];
|
|
897
893
|
[screenCancelButton setAction:@selector(cancelButtonClicked:)];
|
|
898
894
|
|
|
@@ -937,6 +933,26 @@ bool startScreenSelection() {
|
|
|
937
933
|
);
|
|
938
934
|
[screenIconView setFrameOrigin:iconCenter];
|
|
939
935
|
|
|
936
|
+
// Add smooth floating animation to screen icon
|
|
937
|
+
CABasicAnimation *screenFloatAnimationX = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
|
|
938
|
+
screenFloatAnimationX.fromValue = @(-5.0);
|
|
939
|
+
screenFloatAnimationX.toValue = @(5.0);
|
|
940
|
+
screenFloatAnimationX.duration = 4.0; // Slightly different duration for variety
|
|
941
|
+
screenFloatAnimationX.repeatCount = HUGE_VALF;
|
|
942
|
+
screenFloatAnimationX.autoreverses = YES;
|
|
943
|
+
screenFloatAnimationX.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
|
944
|
+
[screenIconView.layer addAnimation:screenFloatAnimationX forKey:@"floatAnimationX"];
|
|
945
|
+
|
|
946
|
+
// Subtle vertical float for screen icon
|
|
947
|
+
CABasicAnimation *screenFloatAnimationY = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
|
|
948
|
+
screenFloatAnimationY.fromValue = @(-2.0);
|
|
949
|
+
screenFloatAnimationY.toValue = @(2.0);
|
|
950
|
+
screenFloatAnimationY.duration = 5.0; // Different timing than window icons
|
|
951
|
+
screenFloatAnimationY.repeatCount = HUGE_VALF;
|
|
952
|
+
screenFloatAnimationY.autoreverses = YES;
|
|
953
|
+
screenFloatAnimationY.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
|
954
|
+
[screenIconView.layer addAnimation:screenFloatAnimationY forKey:@"floatAnimationY"];
|
|
955
|
+
|
|
940
956
|
// Position info label at screen center, above button
|
|
941
957
|
NSPoint labelCenter = NSMakePoint(
|
|
942
958
|
(screenFrame.size.width - [screenInfoLabel frame].size.width) / 2, // Center horizontally
|
|
@@ -1107,21 +1123,20 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1107
1123
|
g_overlayView = [[WindowSelectorOverlayView alloc] initWithFrame:initialFrame];
|
|
1108
1124
|
[g_overlayWindow setContentView:g_overlayView];
|
|
1109
1125
|
|
|
1110
|
-
// Create select button with
|
|
1111
|
-
g_selectButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0,
|
|
1126
|
+
// Create select button with purple theme
|
|
1127
|
+
g_selectButton = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
|
|
1112
1128
|
[g_selectButton setTitle:@"Start Record"];
|
|
1113
1129
|
[g_selectButton setButtonType:NSButtonTypeMomentaryPushIn];
|
|
1114
1130
|
[g_selectButton setBezelStyle:NSBezelStyleRegularSquare];
|
|
1115
|
-
[g_selectButton setFont:[NSFont systemFontOfSize:16 weight:
|
|
1131
|
+
[g_selectButton setFont:[NSFont systemFontOfSize:16 weight:NSFontWeightRegular]];
|
|
1116
1132
|
|
|
1117
|
-
// Modern button styling with purple
|
|
1133
|
+
// Modern button styling with purple tone
|
|
1118
1134
|
[g_selectButton setWantsLayer:YES];
|
|
1119
|
-
[g_selectButton.layer setBackgroundColor:[[NSColor colorWithRed:0.
|
|
1135
|
+
[g_selectButton.layer setBackgroundColor:[[NSColor colorWithRed:0.55 green:0.3 blue:0.75 alpha:0.95] CGColor]];
|
|
1120
1136
|
[g_selectButton.layer setCornerRadius:14.0];
|
|
1121
1137
|
[g_selectButton.layer setBorderWidth:0.0];
|
|
1122
1138
|
|
|
1123
|
-
//
|
|
1124
|
-
[g_selectButton setFont:[NSFont systemFontOfSize:17 weight:NSFontWeightSemibold]];
|
|
1139
|
+
// Clean white text - normal weight
|
|
1125
1140
|
NSMutableAttributedString *titleString = [[NSMutableAttributedString alloc]
|
|
1126
1141
|
initWithString:[g_selectButton title]];
|
|
1127
1142
|
[titleString addAttribute:NSForegroundColorAttributeName
|
|
@@ -1129,12 +1144,6 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1129
1144
|
range:NSMakeRange(0, [titleString length])];
|
|
1130
1145
|
[g_selectButton setAttributedTitle:titleString];
|
|
1131
1146
|
|
|
1132
|
-
// Enhanced shadow for modern look - purple tone
|
|
1133
|
-
[g_selectButton.layer setShadowColor:[[NSColor colorWithRed:0.4 green:0.2 blue:0.6 alpha:0.8] CGColor]];
|
|
1134
|
-
[g_selectButton.layer setShadowOffset:NSMakeSize(0, -3)];
|
|
1135
|
-
[g_selectButton.layer setShadowRadius:8.0];
|
|
1136
|
-
[g_selectButton.layer setShadowOpacity:0.4];
|
|
1137
|
-
|
|
1138
1147
|
// Create delegate for button action and timer
|
|
1139
1148
|
g_delegate = [[WindowSelectorDelegate alloc] init];
|
|
1140
1149
|
[g_selectButton setTarget:g_delegate];
|
|
@@ -1148,16 +1157,15 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1148
1157
|
[cancelButton setTitle:@"Cancel"];
|
|
1149
1158
|
[cancelButton setButtonType:NSButtonTypeMomentaryPushIn];
|
|
1150
1159
|
[cancelButton setBezelStyle:NSBezelStyleRegularSquare];
|
|
1151
|
-
[cancelButton setFont:[NSFont systemFontOfSize:14 weight:
|
|
1160
|
+
[cancelButton setFont:[NSFont systemFontOfSize:14 weight:NSFontWeightRegular]];
|
|
1152
1161
|
|
|
1153
|
-
// Modern cancel button styling
|
|
1162
|
+
// Modern cancel button styling - darker gray, clean
|
|
1154
1163
|
[cancelButton setWantsLayer:YES];
|
|
1155
|
-
[cancelButton.layer setBackgroundColor:[[NSColor colorWithRed:0.
|
|
1164
|
+
[cancelButton.layer setBackgroundColor:[[NSColor colorWithRed:0.35 green:0.35 blue:0.4 alpha:0.9] CGColor]];
|
|
1156
1165
|
[cancelButton.layer setCornerRadius:12.0];
|
|
1157
1166
|
[cancelButton.layer setBorderWidth:0.0];
|
|
1158
1167
|
|
|
1159
|
-
//
|
|
1160
|
-
[cancelButton setFont:[NSFont systemFontOfSize:15 weight:NSFontWeightMedium]];
|
|
1168
|
+
// Clean white text for cancel button
|
|
1161
1169
|
NSMutableAttributedString *cancelTitleString = [[NSMutableAttributedString alloc]
|
|
1162
1170
|
initWithString:[cancelButton title]];
|
|
1163
1171
|
[cancelTitleString addAttribute:NSForegroundColorAttributeName
|
|
@@ -1165,12 +1173,6 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1165
1173
|
range:NSMakeRange(0, [cancelTitleString length])];
|
|
1166
1174
|
[cancelButton setAttributedTitle:cancelTitleString];
|
|
1167
1175
|
|
|
1168
|
-
// Enhanced shadow for cancel button
|
|
1169
|
-
[cancelButton.layer setShadowColor:[[NSColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:0.8] CGColor]];
|
|
1170
|
-
[cancelButton.layer setShadowOffset:NSMakeSize(0, -2)];
|
|
1171
|
-
[cancelButton.layer setShadowRadius:4.0];
|
|
1172
|
-
[cancelButton.layer setShadowOpacity:0.3];
|
|
1173
|
-
|
|
1174
1176
|
[cancelButton setTarget:g_delegate];
|
|
1175
1177
|
[cancelButton setAction:@selector(cancelButtonClicked:)];
|
|
1176
1178
|
|