-
-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(native): add initial tray-support for macOS #972
base: master
Are you sure you want to change the base?
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: is this still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lessp! I'm going to push up some changes to the unwrap/wrap semantics, but other than that it looks great!
This adds tray-support for macOS like so:
Begins to address #322