feat(native): add initial tray-support for macOS#972
Conversation
|
I have updated your lock dirs and formatted the code. |
|
Not sure how we'd like to separate things going forward without naked pointers. I guess we could keep a similar structure but we'd need to import the ocaml-ffi-helpers in Currently src/Native/tray_cocoa.c is unused and I dumped all of that into cc @zbaylin |
1aeae23 to
9e0b01f
Compare
|
I can't wait to try this! Is it on pause indefinitely or just delayed? |
hey @cdaringe, currently (unfortunately) I have extremely limited free-time for OSS, so if anyone wants to take this further feel free. 🙂 |
|
Merged with master and moved the examples to a separate file, I believe what's left here is:
|
|
Hey Zach, I believe this covers the first minimal surface area, albeit for macOS only:
Very possible that I might have missed something! |
zbaylin
left a comment
There was a problem hiding this comment.
Hey @lessp -- so happy to finally see this getting in! I had some minor comments (mostly just rebasing with new APIs like the revery_wrapPointer). I also wonder if it's possible to hook into the NSMenu stuff here too. Maybe that should be a separate PR, though.
Thanks for the review Zach, feels like I left quite a bit for you there! 😄
Yeah, that would have to be up for grabs, just thought I'd try to get this in! |
|
|
||
| statusItem.button.image = nsImage; | ||
|
|
||
| UNUSED(imagePath); |
There was a problem hiding this comment.
Hmm, actually, I don't know 🤔 Most likely I followed another example, but looking at the context, I was under the impression that it is, but this is your forte!
if (vImagePath != Val_none) {
const char *imagePath = String_val(Some_val(vImagePath));
NSImage *nsImage = revery_makeImageFromAbsolutePath_cocoa(imagePath);
statusItem.button.image = nsImage;
UNUSED(imagePath);
}
This adds tray-support for macOS like so:
Begins to address #322