Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upPopupMenu: Fix inconsistency setting text/xl_text in add_* methods #32638
Conversation
Also adds `add_icon_radio_check_shortcut` matching `add_icon_radio_check_item`, binds them for scripting languages, and binds `add_multistate_item`.
#define ITEM_SETUP_WITH_SHORTCUT(p_shortcut, p_id, p_global) \ | ||
ERR_FAIL_COND_MSG(p_shortcut.is_null(), "Cannot add item with invalid ShortCut."); \ | ||
_ref_shortcut(p_shortcut); \ | ||
item.text = p_shortcut->get_name(); \ |
This comment has been minimized.
This comment has been minimized.
akien-mga
Oct 8, 2019
•
Author
Member
This is the main logic change, where add_shortcut*
methods will now properly set the Item
's text
and xl_text
to the ShortCut
's name.
This comment has been minimized.
This comment has been minimized.
Cherry-picked for 3.1.2. (Only commit 58dd5d0.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
akien-mga commentedOct 8, 2019
•
edited
Part 1, cleanup: Reorder
add_*
methods in more natural orderAlso adds
add_icon_radio_check_shortcut
matchingadd_icon_radio_check_item
,binds them for scripting languages, and binds
add_multistate_item
.Part 2, bugfix for #25519: Fix missing
text
/xl_text
when usingadd_shortcut
Use macros to ensure that
text
,xl_text
andid
are always setusing the same logic.
Fixes #25519.
Also fixes up #26914 when
p_id == -1
handling was only added for acouple methods instead of all of them. (upcoming)
For the reference the second commit is basically the same as #25841 (which was reverted), but together with a proper fix for the editor bug it exposed back then (#25900).
BTW, this PopupMenu API is a complete mess :o)
We shouldn't need to have so many duplicated methods to add items with specific configuration changes.