node-mac-recorder 2.10.32 → 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 +35 -19
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -326,8 +326,8 @@ void updateScreenOverlays();
|
|
|
326
326
|
self = [super initWithFrame:frameRect];
|
|
327
327
|
if (self) {
|
|
328
328
|
self.wantsLayer = YES;
|
|
329
|
-
// Semi-transparent
|
|
330
|
-
self.layer.backgroundColor = [[NSColor colorWithRed:0.
|
|
329
|
+
// Semi-transparent black background for screen overlay (same as window overlay)
|
|
330
|
+
self.layer.backgroundColor = [[NSColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.3] CGColor];
|
|
331
331
|
// Ensure no borders or decorations
|
|
332
332
|
self.layer.borderWidth = 1.0;
|
|
333
333
|
self.layer.cornerRadius = 8.0;
|
|
@@ -387,8 +387,8 @@ void updateScreenOverlays();
|
|
|
387
387
|
self = [super initWithFrame:frameRect];
|
|
388
388
|
if (self) {
|
|
389
389
|
self.wantsLayer = YES;
|
|
390
|
-
// Semi-transparent
|
|
391
|
-
self.layer.backgroundColor = [[NSColor colorWithRed:0.
|
|
390
|
+
// Semi-transparent black background for screen overlay (same as window overlay)
|
|
391
|
+
self.layer.backgroundColor = [[NSColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.3] CGColor];
|
|
392
392
|
// Ensure no borders or decorations
|
|
393
393
|
self.layer.borderWidth = 1.0;
|
|
394
394
|
self.layer.cornerRadius = 8.0;
|
|
@@ -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
|
}
|
|
@@ -1524,7 +1540,7 @@ bool startScreenSelection() {
|
|
|
1524
1540
|
// Position screen icon above center
|
|
1525
1541
|
NSPoint iconCenter = NSMakePoint(
|
|
1526
1542
|
(screenFrame.size.width - 96) / 2, // Center horizontally (icon is 96px wide)
|
|
1527
|
-
(screenFrame.size.height / 2) +
|
|
1543
|
+
(screenFrame.size.height / 2) + 120 // 120px above center
|
|
1528
1544
|
);
|
|
1529
1545
|
[screenIconView setFrameOrigin:iconCenter];
|
|
1530
1546
|
|
|
@@ -1541,13 +1557,13 @@ bool startScreenSelection() {
|
|
|
1541
1557
|
// Position info label between icon and button
|
|
1542
1558
|
NSPoint labelCenter = NSMakePoint(
|
|
1543
1559
|
(screenFrame.size.width - [screenInfoLabel frame].size.width) / 2, // Center horizontally
|
|
1544
|
-
(screenFrame.size.height / 2) +
|
|
1560
|
+
(screenFrame.size.height / 2) + 50 // 50px above center, below icon
|
|
1545
1561
|
);
|
|
1546
1562
|
[screenInfoLabel setFrameOrigin:labelCenter];
|
|
1547
1563
|
|
|
1548
1564
|
NSPoint cancelButtonCenter = NSMakePoint(
|
|
1549
1565
|
(screenFrame.size.width - [screenCancelButton frame].size.width) / 2,
|
|
1550
|
-
(screenFrame.size.height / 2) -
|
|
1566
|
+
(screenFrame.size.height / 2) - 80 // 80px below center
|
|
1551
1567
|
);
|
|
1552
1568
|
[screenCancelButton setFrameOrigin:cancelButtonCenter];
|
|
1553
1569
|
|