Merge pull request #89588 from bruvzg/status_ind_menu_direct

[StatusIndicator] Switch API to use Texture2D instead of Image, improve handling on macOS, add method to set native popup menu directly.
This commit is contained in:
Rémi Verschelde
2024-05-01 09:54:44 +02:00
14 changed files with 188 additions and 89 deletions

View File

@@ -58,7 +58,7 @@
</method>
<method name="create_status_indicator">
<return type="int" />
<param index="0" name="icon" type="Image" />
<param index="0" name="icon" type="Texture2D" />
<param index="1" name="tooltip" type="String" />
<param index="2" name="callback" type="Callable" />
<description>
@@ -1178,11 +1178,22 @@
<method name="status_indicator_set_icon">
<return type="void" />
<param index="0" name="id" type="int" />
<param index="1" name="icon" type="Image" />
<param index="1" name="icon" type="Texture2D" />
<description>
Sets the application status indicator icon.
</description>
</method>
<method name="status_indicator_set_menu">
<return type="void" />
<param index="0" name="id" type="int" />
<param index="1" name="menu_rid" type="RID" />
<description>
Sets the application status indicator native popup menu.
[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.
</description>
</method>
<method name="status_indicator_set_tooltip">
<return type="void" />
<param index="0" name="id" type="int" />