-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add options to MacOS menu bar menus #74
Comments
You probably mean the system menubar that only mac has. In case anyone wants to implement this you would need to add menu items in |
I can try to do it but let's discuss list of options in this menu, their grouping etc... |
I want to do the necessary changes to the menu. Personally I was annoyed by the missing Hide command. Adding that was easy, works just fine. But for a PR I would do the full menu. But I don't understand how to add a command like "Add Torrent". In macos.rs I added a menu entry with the ID "addTorrent", now what do I need to do in main.rs? I think I need the serverModal somehow, but no idea how to get it.
|
There is ongoing effort to migrate TrguiNG to tauri v2 which will affect the code you are touching, you might want to do your changes on top of On the topic: the way you communicate with frontend is through events. You can't get specific modal from rust because "modal"s which are just html elements only exist in the frontend. The algo on backend should be like this:
On frontend you add a listener to
|
I'm not really familiar with tauri and rust (yet?), but I will give it a try to check the tauri v2 branch. For now I finally got the Open Torrent menu to work. Before I do the rest of the menu it would be great if you could have a look at what I did so far. macos.rs: main.rs and servermodals.tsx: hotkeys.ts: toolbar.tsx: So, what do you think? |
Your commit is headed in the right direction but you will have to redo it on tauri v2 branch because menu APIs changed in tauri.
Reason is with native item the app does not receive window close event and will not save the config. I could catch the termination event and have a custom handler for that but having a custom menu event is easier.
No reason, whoever makes them consistent gets a cookie. I probably added them at different times or copied different examples.
Mostly, just do it on top of tauri v2 branch. Don't name the event "addTorrent", make it "openModal" and pass which modal as data of the event. You will also have to make sure other modals are not opened already when you extend this to more modals.
That's because macos needs native menu item for it to work, tauriv2 branch has this fixed. I do agree about cmd+o, it is ubiquitous to mean "open" action. You can change current cmd+o to cmd+k. |
It isn't "not as easy" but it's impossible because pressing cmd+alt+5 is something different than cmd+[. It just doesn't trigger.
Where does the user activate the hide logic? I will have a look at the Tauri v2 branch now, and try to implement the changes as you mentioned. |
And that is ok because the feature is used once or twice total.
It activates automatically when you minimize/close the window, based on your preferences. |
Feature request: it would be nice to have things like server settings and layout accessible from menu options.
The text was updated successfully, but these errors were encountered: