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