Skip to content
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: menu items on Mac (maybe also other OSs?) #6

Open
Bellisario opened this issue Aug 11, 2023 · 4 comments
Open

feat: menu items on Mac (maybe also other OSs?) #6

Bellisario opened this issue Aug 11, 2023 · 4 comments
Labels
enhancement New feature or request macOS A fix or implementation is required for platforms running macOS.

Comments

@Bellisario
Copy link

Currently on Mac you need to click the close button to quit.
Would be useful to allow the usage of "standard" macOS shortcut for app actions (ex. CMD+Q, CMD+W, CMD+H, CMD+M, etc.).

Also, custom menu items support as Electron or Tauri would be fantastic.
Anyway, I tried looking in the Tauri source code but I was not able to understand the code (I'm not a Rust DEV), but I found the implementation should be here: https://github.com/tauri-apps/tauri/blob/dev/core/tauri-runtime/src/menu.rs

@ttytm
Copy link
Owner

ttytm commented Aug 11, 2023

Hey @Bellisario,

Thanks for reaching out. The problem with mac seems to be kown upstream with webview and macOS
webview/webview#397, webview/webview#237

I'll look into it and think about a solution that is fitting for this binding.

As a quick-fix solution to implement shortcuts for now - though without a menu: You could implement shortcuts in JS. E.g. a cmd+q shortcut could call a V function to exit the application.

@ttytm ttytm added enhancement(upstream) enhancement New feature or request webview C A fix or implementation is required in the upstream webview library and removed enhancement(upstream) labels Sep 5, 2023
@Ouri028
Copy link
Contributor

Ouri028 commented Sep 15, 2023

Currently on Mac you need to click the close button to quit. Would be useful to allow the usage of "standard" macOS shortcut for app actions (ex. CMD+Q, CMD+W, CMD+H, CMD+M, etc.).

Also, custom menu items support as Electron or Tauri would be fantastic. Anyway, I tried looking in the Tauri source code but I was not able to understand the code (I'm not a Rust DEV), but I found the implementation should be here: https://github.com/tauri-apps/tauri/blob/dev/core/tauri-runtime/src/menu.rs

In regards to the custom menu items, I am busy developing a custom one for V using C, currently its still very early on and only supports Windows, but I am hoping to add Linux soon after, but MacOS will be a bit challenging since, I don't own a Mac, so will need someone else who is willing to help with that.

Here is a basic example.

image

@ttytm I am hoping once I am done to allow me to create a simple example of using both webview and Vtray together.

@ttytm
Copy link
Owner

ttytm commented Sep 16, 2023

Sounds awesome @Ouri028!

If both libs complement each other ofc. you can add an example.

For a mac tray someone added a nice example to the examples in the V repo a while ago, it might help with mac as well https://github.com/vlang/v/tree/master/examples/macos_tray

@ttytm ttytm added macOS A fix or implementation is required for platforms running macOS. and removed webview C A fix or implementation is required in the upstream webview library labels Sep 25, 2023
@Ouri028
Copy link
Contributor

Ouri028 commented Sep 30, 2023

Hey guys,

I have just added MacOS support for VTray.

I only tested it on macos ventura, since that's what I'm currently use.

image5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request macOS A fix or implementation is required for platforms running macOS.
Projects
None yet
Development

No branches or pull requests

3 participants