node-mac-recorder 2.16.18 โ 2.16.19
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"permissions": {
|
|
3
3
|
"allow": [
|
|
4
|
-
"Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐งช Testing
|
|
4
|
+
"Bash(FORCE_AVFOUNDATION=1 node -e \"\nconsole.log(''๐งช Testing UI elements on ALL screens...'');\nconst WindowSelector = require(''./window-selector.js'');\nconst selector = new WindowSelector();\n\nselector.checkPermissions().then(perms => {\n console.log(''Permissions:'', perms);\n return selector.startSelection();\n}).then(() => {\n console.log(''โ
Window selection started - TEST UI elements on BOTH screens'');\n console.log(''๐ฅ๏ธ Primary display: Move cursor over windows'');\n console.log(''๐ฅ๏ธ External display: Move cursor over windows'');\n console.log(''โก๏ธ Check if Record/Cancel buttons + logo + title appear on BOTH displays'');\n \n setTimeout(() => {\n selector.stopSelection().then(() => {\n console.log(''โ
Test complete'');\n });\n }, 20000);\n}).catch(console.error);\n\")"
|
|
5
5
|
],
|
|
6
6
|
"deny": [],
|
|
7
7
|
"ask": []
|
package/package.json
CHANGED
package/src/window_selector.mm
CHANGED
|
@@ -88,6 +88,7 @@ void updateScreenOverlays();
|
|
|
88
88
|
@property (nonatomic) NSRect highlightFrame;
|
|
89
89
|
@property (nonatomic, strong) NSValue *globalOriginOffset; // Store global coordinate offset
|
|
90
90
|
@property (nonatomic, strong) HoverButton *recordButton;
|
|
91
|
+
@property (nonatomic, strong) HoverButton *cancelButton;
|
|
91
92
|
@property (nonatomic, strong) NSImageView *appIconView;
|
|
92
93
|
@property (nonatomic, strong) NSTextField *infoLabel;
|
|
93
94
|
- (void)setHighlightFrame:(NSRect)frame;
|
|
@@ -233,6 +234,11 @@ void updateScreenOverlays();
|
|
|
233
234
|
- (void)setupUIElements {
|
|
234
235
|
NSLog(@"๐ง Setting up integrated UI elements");
|
|
235
236
|
|
|
237
|
+
// Ensure delegate exists
|
|
238
|
+
if (!g_delegate) {
|
|
239
|
+
NSLog(@"โ ๏ธ No delegate found in setupUIElements, this may cause button click issues");
|
|
240
|
+
}
|
|
241
|
+
|
|
236
242
|
// Create record button
|
|
237
243
|
self.recordButton = [[HoverButton alloc] initWithFrame:NSMakeRect(0, 0, 200, 60)];
|
|
238
244
|
[self.recordButton setTitle:@"Start Recording"];
|
|
@@ -249,6 +255,22 @@ void updateScreenOverlays();
|
|
|
249
255
|
|
|
250
256
|
[self addSubview:self.recordButton];
|
|
251
257
|
|
|
258
|
+
// Create cancel button
|
|
259
|
+
self.cancelButton = [[HoverButton alloc] initWithFrame:NSMakeRect(0, 0, 120, 40)];
|
|
260
|
+
[self.cancelButton setTitle:@"Cancel"];
|
|
261
|
+
[self.cancelButton setFont:[NSFont systemFontOfSize:14.0 weight:NSFontWeightMedium]];
|
|
262
|
+
[self.cancelButton setBezelStyle:NSBezelStyleRounded];
|
|
263
|
+
[self.cancelButton setTarget:g_delegate];
|
|
264
|
+
[self.cancelButton setAction:@selector(cancelButtonClicked:)];
|
|
265
|
+
|
|
266
|
+
// Style the cancel button
|
|
267
|
+
self.cancelButton.wantsLayer = YES;
|
|
268
|
+
self.cancelButton.layer.backgroundColor = [[NSColor colorWithRed:0.6 green:0.6 blue:0.6 alpha:0.9] CGColor];
|
|
269
|
+
self.cancelButton.layer.cornerRadius = 6.0;
|
|
270
|
+
self.cancelButton.layer.borderWidth = 0.0;
|
|
271
|
+
|
|
272
|
+
[self addSubview:self.cancelButton];
|
|
273
|
+
|
|
252
274
|
// Create app icon view
|
|
253
275
|
self.appIconView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, 96, 96)];
|
|
254
276
|
[self.appIconView setImageScaling:NSImageScaleProportionallyUpOrDown];
|
|
@@ -307,6 +329,7 @@ void updateScreenOverlays();
|
|
|
307
329
|
if (NSEqualRects(self.highlightFrame, NSZeroRect)) {
|
|
308
330
|
// Hide elements when no window is highlighted
|
|
309
331
|
[self.recordButton setHidden:YES];
|
|
332
|
+
[self.cancelButton setHidden:YES];
|
|
310
333
|
[self.appIconView setHidden:YES];
|
|
311
334
|
[self.infoLabel setHidden:YES];
|
|
312
335
|
return;
|
|
@@ -314,6 +337,7 @@ void updateScreenOverlays();
|
|
|
314
337
|
|
|
315
338
|
// Show elements
|
|
316
339
|
[self.recordButton setHidden:NO];
|
|
340
|
+
[self.cancelButton setHidden:NO];
|
|
317
341
|
[self.appIconView setHidden:NO];
|
|
318
342
|
[self.infoLabel setHidden:NO];
|
|
319
343
|
|
|
@@ -352,8 +376,16 @@ void updateScreenOverlays();
|
|
|
352
376
|
windowCenterY + 50 // 50px above window center
|
|
353
377
|
)];
|
|
354
378
|
|
|
355
|
-
|
|
379
|
+
// Position cancel button below record button
|
|
380
|
+
NSSize cancelButtonSize = self.cancelButton.frame.size;
|
|
381
|
+
[self.cancelButton setFrameOrigin:NSMakePoint(
|
|
382
|
+
windowCenterX - (cancelButtonSize.width / 2),
|
|
383
|
+
windowCenterY - 80 // 80px below window center
|
|
384
|
+
)];
|
|
385
|
+
|
|
386
|
+
NSLog(@"๐ UI elements positioned - Button:(%.0f,%.0f) Cancel:(%.0f,%.0f) Icon:(%.0f,%.0f) Label:(%.0f,%.0f)",
|
|
356
387
|
self.recordButton.frame.origin.x, self.recordButton.frame.origin.y,
|
|
388
|
+
self.cancelButton.frame.origin.x, self.cancelButton.frame.origin.y,
|
|
357
389
|
self.appIconView.frame.origin.x, self.appIconView.frame.origin.y,
|
|
358
390
|
self.infoLabel.frame.origin.x, self.infoLabel.frame.origin.y);
|
|
359
391
|
}
|
|
@@ -1868,6 +1900,12 @@ Napi::Value StartWindowSelection(const Napi::CallbackInfo& info) {
|
|
|
1868
1900
|
|
|
1869
1901
|
NSLog(@"๐ฅ๏ธ Creating per-screen overlays for %lu displays", [allScreens count]);
|
|
1870
1902
|
|
|
1903
|
+
// Ensure delegate exists for all overlays
|
|
1904
|
+
if (!g_delegate) {
|
|
1905
|
+
g_delegate = [[WindowSelectorDelegate alloc] init];
|
|
1906
|
+
NSLog(@"๐๏ธ Created global delegate for all overlays");
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1871
1909
|
// Create overlay for each screen
|
|
1872
1910
|
for (NSInteger i = 0; i < [allScreens count]; i++) {
|
|
1873
1911
|
NSScreen *screen = [allScreens objectAtIndex:i];
|