node-mac-recorder 2.10.26 → 2.10.27

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-mac-recorder",
3
- "version": "2.10.26",
3
+ "version": "2.10.27",
4
4
  "description": "Native macOS screen recording package for Node.js applications",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -120,18 +120,11 @@ void updateScreenOverlays();
120
120
  // Locked state: slightly different opacity with darker purple stroke
121
121
  fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.5];
122
122
  strokeColor = [NSColor colorWithRed:0.45 green:0.25 blue:0.75 alpha:0.9];
123
- } else {
124
- // Normal state: purple fill with lighter purple stroke
125
- fillColor = [NSColor colorWithRed:0.6 green:0.4 blue:0.9 alpha:0.4];
126
- strokeColor = [NSColor colorWithRed:0.7 green:0.5 blue:0.95 alpha:0.8];
127
- }
123
+ }
128
124
 
129
125
  [fillColor setFill];
130
126
  [highlightPath fill];
131
-
132
- [strokeColor setStroke];
133
- [highlightPath setLineWidth:1.0];
134
- [highlightPath stroke];
127
+
135
128
  }
136
129
 
137
130
  - (void)updateAppearance {
@@ -222,11 +215,34 @@ void updateScreenOverlays();
222
215
  - (void)mouseEntered:(NSEvent *)event {
223
216
  self.isHovered = YES;
224
217
  [[NSCursor pointingHandCursor] set];
218
+
219
+ // Brighten background on hover
220
+ if (self.layer.backgroundColor) {
221
+ CGFloat red, green, blue, alpha;
222
+ NSColor *currentColor = [NSColor colorWithCGColor:self.layer.backgroundColor];
223
+ [currentColor getRed:&red green:&green blue:&blue alpha:&alpha];
224
+
225
+ // Increase brightness by 20%
226
+ red = MIN(1.0, red * 1.2);
227
+ green = MIN(1.0, green * 1.2);
228
+ blue = MIN(1.0, blue * 1.2);
229
+
230
+ NSColor *brighterColor = [NSColor colorWithRed:red green:green blue:blue alpha:alpha];
231
+ self.layer.backgroundColor = [brighterColor CGColor];
232
+ }
225
233
  }
226
234
 
227
235
  - (void)mouseExited:(NSEvent *)event {
228
236
  self.isHovered = NO;
229
237
  [[NSCursor arrowCursor] set];
238
+
239
+ // Restore original background color
240
+ NSString *title = [self title];
241
+ if ([title isEqualToString:@"Start Record"]) {
242
+ self.layer.backgroundColor = [[NSColor colorWithRed:90.0/255.0 green:50.0/255.0 blue:250.0/255.0 alpha:1.0] CGColor];
243
+ } else if ([title isEqualToString:@"Cancel"]) {
244
+ self.layer.backgroundColor = [[NSColor colorWithRed:0.4 green:0.4 blue:0.45 alpha:1.0] CGColor];
245
+ }
230
246
  }
231
247
 
232
248
  - (void)animateScale:(CGFloat)scale duration:(NSTimeInterval)duration {
@@ -304,7 +320,7 @@ void updateScreenOverlays();
304
320
  self.wantsLayer = YES;
305
321
  self.layer.backgroundColor = [[NSColor clearColor] CGColor];
306
322
  // Ensure no borders or decorations
307
- self.layer.borderWidth = 0.0;
323
+ self.layer.borderWidth = 1.0;
308
324
  self.layer.cornerRadius = 8.0;
309
325
  self.layer.masksToBounds = YES;
310
326
  self.layer.shadowOpacity = 0.0;
@@ -364,7 +380,7 @@ void updateScreenOverlays();
364
380
  self.wantsLayer = YES;
365
381
  self.layer.backgroundColor = [[NSColor clearColor] CGColor];
366
382
  // Ensure no borders or decorations
367
- self.layer.borderWidth = 0.0;
383
+ self.layer.borderWidth = 1.0;
368
384
  self.layer.cornerRadius = 8.0;
369
385
  self.layer.masksToBounds = YES;
370
386
  self.layer.shadowOpacity = 0.0;
@@ -839,7 +855,7 @@ void updateOverlay() {
839
855
 
840
856
  // Force no borders on info label
841
857
  [infoLabel setWantsLayer:YES];
842
- infoLabel.layer.borderWidth = 0.0;
858
+ infoLabel.layer.borderWidth = 1.0;
843
859
  infoLabel.layer.borderColor = [[NSColor clearColor] CGColor];
844
860
  infoLabel.layer.cornerRadius = 0.0;
845
861
  infoLabel.layer.masksToBounds = YES;
@@ -865,7 +881,7 @@ void updateOverlay() {
865
881
  [appIconView.layer setBackgroundColor:[[NSColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:0.3] CGColor]]; // Debug background
866
882
 
867
883
  // Force no borders on app icon view
868
- appIconView.layer.borderWidth = 0.0;
884
+ appIconView.layer.borderWidth = 1.0;
869
885
  appIconView.layer.borderColor = [[NSColor clearColor] CGColor];
870
886
  appIconView.layer.shadowOpacity = 0.0;
871
887
  appIconView.layer.shadowRadius = 0.0;
@@ -906,20 +922,19 @@ void updateOverlay() {
906
922
  NSString *labelAppName = [windowUnderCursor objectForKey:@"appName"] ?: @"Unknown App";
907
923
  [infoLabel setStringValue:[NSString stringWithFormat:@"%@\n%@", labelAppName, labelWindowTitle]];
908
924
 
909
- // Position buttons - Start Record in center of highlighted window
925
+ // Position buttons - Start Record in center of screen
910
926
  if (g_selectButton) {
911
927
  NSSize buttonSize = [g_selectButton frame].size;
912
- // Convert window coordinates to overlay view coordinates
913
- NSRect highlightFrame = NSMakeRect(x, [g_overlayView frame].size.height - y - height, width, height);
928
+ NSRect screenFrame = [g_overlayView frame];
914
929
  NSPoint buttonCenter = NSMakePoint(
915
- highlightFrame.origin.x + (highlightFrame.size.width - buttonSize.width) / 2,
916
- highlightFrame.origin.y + (highlightFrame.size.height - buttonSize.height) / 2 + 15
930
+ (screenFrame.size.width - buttonSize.width) / 2,
931
+ (screenFrame.size.height - buttonSize.height) / 2 + 30 // Slightly above center
917
932
  );
918
933
  [g_selectButton setFrameOrigin:buttonCenter];
919
934
 
920
- // Position app icon above text label within highlighted area
935
+ // Position app icon above text label in screen center
921
936
  NSPoint iconCenter = NSMakePoint(
922
- highlightFrame.origin.x + (highlightFrame.size.width - 96) / 2, // Center horizontally within highlight
937
+ (screenFrame.size.width - 96) / 2, // Center horizontally on screen
923
938
  buttonCenter.y + buttonSize.height + 60 + 10 // Above label + text height + margin
924
939
  );
925
940
  [appIconView setFrameOrigin:iconCenter];
@@ -940,9 +955,9 @@ void updateOverlay() {
940
955
  floatAnimationX.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
941
956
  [appIconView.layer addAnimation:floatAnimationX forKey:@"floatAnimationX"];
942
957
 
943
- // Position info label within highlighted area, above button
958
+ // Position info label in screen center, above button
944
959
  NSPoint labelCenter = NSMakePoint(
945
- highlightFrame.origin.x + (highlightFrame.size.width - [infoLabel frame].size.width) / 2, // Center horizontally within highlight
960
+ (screenFrame.size.width - [infoLabel frame].size.width) / 2, // Center horizontally on screen
946
961
  buttonCenter.y + buttonSize.height + 10 // 10px above button, below icon
947
962
  );
948
963
  [infoLabel setFrameOrigin:labelCenter];
@@ -960,7 +975,7 @@ void updateOverlay() {
960
975
  if (cancelButton) {
961
976
  NSSize cancelButtonSize = [cancelButton frame].size;
962
977
  NSPoint cancelButtonCenter = NSMakePoint(
963
- highlightFrame.origin.x + (highlightFrame.size.width - cancelButtonSize.width) / 2,
978
+ (screenFrame.size.width - cancelButtonSize.width) / 2, // Center horizontally on screen
964
979
  buttonCenter.y - buttonSize.height - 20 // 20px below main button
965
980
  );
966
981
  [cancelButton setFrameOrigin:cancelButtonCenter];
@@ -979,7 +994,7 @@ void updateOverlay() {
979
994
  if ([subview respondsToSelector:@selector(setWantsLayer:)]) {
980
995
  [subview setWantsLayer:YES];
981
996
  if (subview.layer) {
982
- subview.layer.borderWidth = 0.0;
997
+ subview.layer.borderWidth = 1.0;
983
998
  subview.layer.borderColor = [[NSColor clearColor] CGColor];
984
999
  subview.layer.masksToBounds = YES;
985
1000
  subview.layer.shadowOpacity = 0.0;