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

[Feature Request] Implement native macOS menu bar #385

Open
GabCoolDude opened this issue Dec 15, 2024 · 3 comments
Open

[Feature Request] Implement native macOS menu bar #385

GabCoolDude opened this issue Dec 15, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@GabCoolDude
Copy link
Collaborator

GabCoolDude commented Dec 15, 2024

Overview

Currently, Ryujinx, does not use the native macOS menu bar, and instead uses its own menu bar:

Screenshot 2024-12-15 at 09 44 34

I would like to implement this myself, so I looked into avalonia's current implementation of the macOS menu bar using NativeMenu and NativeMenuBar. Whatever I do, NativeMenuBar will not work and idk why. On the other hand NativeMenu, and its "sub-class" NativeMenuItemalso won't work because:

  1. It doesn't support tooltips, and therefore other platforms wont have tooltips anymore (minor)
  2. It doesn't support Name or Tag, meaning that Click will always reference NativeMenuItem, basically meaning you cant do case by case. I tried to do a workaround using Command and Gesture and checking for it in MainMenuBarView.axaml.cs but it wont work for some reason.

With that information, I came to a conclusion. Either we ASK avalonia to add these things and update to the version that implements it, or we use SwiftUI for the menu bar.
I looked a bit further into using SwiftUI, since it's basically my only option at this point, and it looks like we'll need to use .net 9, which added support for Swift bindings and some libraries.

So, we're waiting on either avalonia, or .net 9 support in Ryujinx.

Smaller details

Things we'd have to use: NSStatusBar, NSStatusItem and probably NSStatusBarButton for styling(?)

Nature of request

I like the macOS native menu bar, and also it saves some space on the screen.

Why would this feature be useful?

Makes Ryujinx look a bit nicer on macOS.

@GabCoolDude GabCoolDude added the enhancement New feature or request label Dec 15, 2024
@GabCoolDude
Copy link
Collaborator Author

GabCoolDude commented Dec 15, 2024

Now that I think about it, Swift is definitely the way to go on this, for 2 reasons:

  • No more tooltips for other platforms if we use avalonia.
  • We'd have to ask avalonia to implement names and tags on NativeMenuItem, wait for it to be implemented, and then once it's implemented wait for a release, and then update to that release, which might break other stuff.

@InstantRamenPack
Copy link

+1. Also allows for shortcuts widely used across MacOS applications to also apply to Ryujinx, such as cmd+comma for preferences.

@GabCoolDude
Copy link
Collaborator Author

Now, that .NET 9 has been implemented, I can start working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants