Lakr233 / NotchDrop

Use your MacBook's notch like Dynamic Island for temporary storing files and AirDrop
MIT License
1.5k stars 92 forks source link

Close notch when dragging file away #46

Closed ZackEberhart closed 2 months ago

ZackEberhart commented 2 months ago

Adjusts the NotchView's DragDetector to close the Notch when a file is dragged away.

This could be togglable option, but in my experience, I've strongly preferred it to auto-close.

Implementation note: because hovering the AirDrop and TrayDrop take focus from the NotchView, an extra check is required when de-targeting the NotchView to make sure the mouse has actually left the box; ergo the if !vm.notchOpenedRect.insetBy(dx: vm.inset, dy: vm.inset).contains(mouseLocation){ line

P.S., Love this project!

Prior behavior:

https://github.com/user-attachments/assets/e66ca40e-d120-4c61-a492-d8a57e555b9f

New Behavior:

https://github.com/user-attachments/assets/b9d06549-b1cb-4d8d-a75d-4b9ee4e0c3de

Lakr233 commented 2 months ago

Thanks! Will keep it up~