-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
[StatusIndicator] Switch API to use Texture2D instead of Image, improve handling on macOS, add method to set native popup menu directly. #89588
Conversation
9be3957
to
457df33
Compare
doc/classes/DisplayServer.xml
Outdated
[b]Note:[/b] On macOS, menu is activated by any mouse button, activation callback is not triggered. | ||
[b]Note:[/b] On Windows, menu is activated by right mouse button, selecting icon and pressing Shift+F10 or the applications key, activation callback for the other mouse buttons is still triggered. | ||
[b]Note:[/b] Native popup is supported only if [NativeMenu] supports [constant NativeMenu.FEATURE_POPUP_MENU] feature. |
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.
[b]Note:[/b] On macOS, menu is activated by any mouse button, activation callback is not triggered. | |
[b]Note:[/b] On Windows, menu is activated by right mouse button, selecting icon and pressing Shift+F10 or the applications key, activation callback for the other mouse buttons is still triggered. | |
[b]Note:[/b] Native popup is supported only if [NativeMenu] supports [constant NativeMenu.FEATURE_POPUP_MENU] feature. | |
[b]Note:[/b] On macOS, the menu is activated by any mouse button. Its activation callback is [i]not[/i] triggered. | |
[b]Note:[/b] On Windows, the menu is activated by the right mouse button, selecting the status icon and pressing [kbd]Shift + F10[/kbd], or the applications key. The menu's activation callback for the other mouse buttons is still triggered. | |
[b]Note:[/b] Native popup is only supported if [NativeMenu] supports the [constant NativeMenu.FEATURE_POPUP_MENU] feature. |
... What's the "selecting icon" and "applications key" though?
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.
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.
You learn something new every day... It may be worth mentioning the KEY_*
constant equivalent if it does exist.
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.
Interesting, I always thought this was the context key.
…ve handling on macOS, add method to set native popup menu directly.
457df33
to
0587a1d
Compare
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.
Looks fine!
I'm not very experienced with the MacOS and Windows stuff but no obvious red flags appear.
I can also see, if I understand correctly, that you used the native popup menu API for MacOS, which is great!
Thanks! |
Texture2D
instead ofImage
(as most other UI element do, breaking change from the previous dev release, but API was not present in any previous stable releases).DisplayServer
and property toStatusIndicator
node) to set native popup menu directly, since this is a most common use for indicators (also to match https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem/ for the future Linux implementation which might miss other ways to position popup).