mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Improve MenuButton and OptionButton
* MenuButton + OptionButton: Add method `show_popup()` which performs required popup setup before showing (prefer use of this over `get_popup()->popup()`, otherwise GH #66308 occurs) * MenuButton: Ensure that the menu can be opened with a shortcut, if one is set for the button. (GH #66403). Ensure that popupmenu item shortcuts are checked first before the MenuButton shortcut.
This commit is contained in:
@@ -25,6 +25,12 @@
|
||||
If [code]true[/code], shortcuts are disabled and cannot be used to trigger the button.
|
||||
</description>
|
||||
</method>
|
||||
<method name="show_popup">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Adjusts popup position and sizing for the [MenuButton], then shows the [PopupMenu]. Prefer this over using [code]get_popup().popup()[/code].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="action_mode" type="int" setter="set_action_mode" getter="get_action_mode" overrides="BaseButton" enum="BaseButton.ActionMode" default="0" />
|
||||
|
||||
Reference in New Issue
Block a user