node-mac-recorder 2.10.33 → 2.10.35
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 +30 -13
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -389,8 +389,9 @@ void updateScreenOverlays();
|
|
|
389
389
|
self.wantsLayer = YES;
|
|
390
390
|
// Semi-transparent black background for screen overlay (same as window overlay)
|
|
391
391
|
self.layer.backgroundColor = [[NSColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.3] CGColor];
|
|
392
|
-
//
|
|
392
|
+
// Purple border for screen selection (same as window highlight)
|
|
393
393
|
self.layer.borderWidth = 1.0;
|
|
394
|
+
self.layer.borderColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.9] CGColor];
|
|
394
395
|
self.layer.cornerRadius = 8.0;
|
|
395
396
|
self.layer.masksToBounds = YES;
|
|
396
397
|
self.layer.shadowOpacity = 0.0;
|
|
@@ -419,6 +420,20 @@ void updateScreenOverlays();
|
|
|
419
420
|
// No border for clean look
|
|
420
421
|
}
|
|
421
422
|
|
|
423
|
+
- (void)setIsActiveScreen:(BOOL)isActive {
|
|
424
|
+
_isActiveScreen = isActive;
|
|
425
|
+
|
|
426
|
+
if (isActive) {
|
|
427
|
+
// Active screen: locked state purple border (#3d00b047)
|
|
428
|
+
self.layer.borderColor = [[NSColor colorWithRed:0.24 green:0.0 blue:0.69 alpha:0.95] CGColor];
|
|
429
|
+
self.layer.backgroundColor = [[NSColor colorWithRed:0.24 green:0.0 blue:0.69 alpha:0.278] CGColor];
|
|
430
|
+
} else {
|
|
431
|
+
// Inactive screen: normal state purple border (#4400c52e)
|
|
432
|
+
self.layer.borderColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.9] CGColor];
|
|
433
|
+
self.layer.backgroundColor = [[NSColor colorWithRed:0.27 green:0.0 blue:0.77 alpha:0.18] CGColor];
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
422
437
|
@end
|
|
423
438
|
|
|
424
439
|
// Button action handler and timer target
|
|
@@ -932,20 +947,22 @@ void updateOverlay() {
|
|
|
932
947
|
NSString *labelAppName = [windowUnderCursor objectForKey:@"appName"] ?: @"Unknown App";
|
|
933
948
|
[infoLabel setStringValue:[NSString stringWithFormat:@"%@\n%@", labelAppName, labelWindowTitle]];
|
|
934
949
|
|
|
935
|
-
// Position buttons - Start Record in
|
|
950
|
+
// Position buttons - Start Record in center of selected window
|
|
936
951
|
if (g_selectButton) {
|
|
937
952
|
NSSize buttonSize = [g_selectButton frame].size;
|
|
938
|
-
|
|
953
|
+
// Use window center for positioning
|
|
954
|
+
CGFloat windowCenterX = x + (width / 2);
|
|
955
|
+
CGFloat windowCenterY = y + (height / 2);
|
|
939
956
|
NSPoint buttonCenter = NSMakePoint(
|
|
940
|
-
|
|
941
|
-
|
|
957
|
+
windowCenterX - (buttonSize.width / 2),
|
|
958
|
+
windowCenterY - (buttonSize.height / 2) // Perfect center of window
|
|
942
959
|
);
|
|
943
960
|
[g_selectButton setFrameOrigin:buttonCenter];
|
|
944
961
|
|
|
945
|
-
// Position app icon above center
|
|
962
|
+
// Position app icon above window center
|
|
946
963
|
NSPoint iconCenter = NSMakePoint(
|
|
947
|
-
|
|
948
|
-
|
|
964
|
+
windowCenterX - (96 / 2), // Center horizontally on window
|
|
965
|
+
windowCenterY + 120 // 120px above window center
|
|
949
966
|
);
|
|
950
967
|
[appIconView setFrameOrigin:iconCenter];
|
|
951
968
|
NSLog(@"🎯 Positioning app icon at: (%.0f, %.0f) for window size: (%.0f, %.0f)",
|
|
@@ -965,10 +982,10 @@ void updateOverlay() {
|
|
|
965
982
|
floatAnimationX.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
|
966
983
|
[appIconView.layer addAnimation:floatAnimationX forKey:@"floatAnimationX"];
|
|
967
984
|
|
|
968
|
-
// Position info label between icon and button
|
|
985
|
+
// Position info label between icon and button relative to window center
|
|
969
986
|
NSPoint labelCenter = NSMakePoint(
|
|
970
|
-
|
|
971
|
-
|
|
987
|
+
windowCenterX - ([infoLabel frame].size.width / 2), // Center horizontally on window
|
|
988
|
+
windowCenterY + 50 // 50px above window center, below icon
|
|
972
989
|
);
|
|
973
990
|
[infoLabel setFrameOrigin:labelCenter];
|
|
974
991
|
|
|
@@ -985,8 +1002,8 @@ void updateOverlay() {
|
|
|
985
1002
|
if (cancelButton) {
|
|
986
1003
|
NSSize cancelButtonSize = [cancelButton frame].size;
|
|
987
1004
|
NSPoint cancelButtonCenter = NSMakePoint(
|
|
988
|
-
|
|
989
|
-
|
|
1005
|
+
windowCenterX - (cancelButtonSize.width / 2), // Center horizontally on window
|
|
1006
|
+
windowCenterY - 80 // 80px below window center
|
|
990
1007
|
);
|
|
991
1008
|
[cancelButton setFrameOrigin:cancelButtonCenter];
|
|
992
1009
|
}
|