-
Notifications
You must be signed in to change notification settings - Fork 570
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 nsmenu title #1846
Add nsmenu title #1846
Conversation
I think that initing with an empty string and then modifying it afterwards to the correct title should be okay? |
Updated it accordingly to use an empty string and added |
druid-shell/examples/shello.rs
Outdated
@@ -123,7 +123,8 @@ impl WinHandler for HelloState { | |||
|
|||
fn main() { | |||
tracing_subscriber::fmt().init(); | |||
let mut file_menu = Menu::new("File Menu"); | |||
let mut file_menu = Menu::new(); | |||
file_menu.set_title("File Menu"); |
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.
maybe just "File"?
Okay so I'm looking at this again, and I want to double-check my understanding:
And in both the case of. the root menu and of a context menu, the title is (I believe) unused? Ultimately I'm wondering if we need to bother with the whole |
@cmyr I agree. I've removed the |
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!
This is an initial fix for #1835.
It uses
::alloc().initWithTitle(...)
to initializeNSMenu
items with a correct title.However, it is not clear to me yet what the behaviour would be for the
Menu
that is exposed from thedruid
crate.Right now I'm calling
Menu("")
but I suppose that's wrong. My guess would be that the public druid API would also expose a title property? But then it would affect all platforms. Open to suggestions here :)