Merge pull request #32003 from codecustard/fix_optionbutton_not_selecting
Fixes OptionButton Not Updating Current Selection
This commit is contained in:
commit
0782082433
1 changed files with 6 additions and 0 deletions
|
@ -116,10 +116,16 @@ void OptionButton::add_item(const String &p_label, int p_id) {
|
|||
void OptionButton::set_item_text(int p_idx, const String &p_text) {
|
||||
|
||||
popup->set_item_text(p_idx, p_text);
|
||||
|
||||
if (current == p_idx)
|
||||
set_text(p_text);
|
||||
}
|
||||
void OptionButton::set_item_icon(int p_idx, const Ref<Texture> &p_icon) {
|
||||
|
||||
popup->set_item_icon(p_idx, p_icon);
|
||||
|
||||
if (current == p_idx)
|
||||
set_icon(p_icon);
|
||||
}
|
||||
void OptionButton::set_item_id(int p_idx, int p_id) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue