diff options
author | EricEzaM <itsjusteza@gmail.com> | 2022-10-02 16:46:37 +1000 |
---|---|---|
committer | EricEzaM <itsjusteza@gmail.com> | 2022-10-03 20:07:39 +1000 |
commit | 272c29793166d7f8662c03d782abecc10d4b6d30 (patch) | |
tree | fce63ef12e6338d4ba101e106cffff44a7a98fe2 /doc | |
parent | e69b7083d45c5d8698508cce7086d361c4b1f44c (diff) |
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/MenuButton.xml | 6 | ||||
-rw-r--r-- | doc/classes/OptionButton.xml | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 1f38510e83..4d5d5a011b 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -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" /> diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index f10c096c1b..199535298c 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -190,6 +190,12 @@ Sets the tooltip of the item at index [param idx]. </description> </method> + <method name="show_popup"> + <return type="void" /> + <description> + Adjusts popup position and sizing for the [OptionButton], 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" /> |