1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #109755 from Giganzo/option-button-icon-clear

Fix OptionButton not removing icon when using clear
This commit is contained in:
Thaddeus Crews
2025-08-19 10:29:43 -05:00

View File

@@ -394,6 +394,7 @@ void OptionButton::add_separator(const String &p_text) {
void OptionButton::clear() { void OptionButton::clear() {
popup->clear(); popup->clear();
set_text(""); set_text("");
set_button_icon(Ref<Texture2D>());
current = NONE_SELECTED; current = NONE_SELECTED;
_refresh_size_cache(); _refresh_size_cache();
} }
@@ -410,7 +411,7 @@ void OptionButton::_select(int p_which, bool p_emit) {
current = NONE_SELECTED; current = NONE_SELECTED;
set_text(""); set_text("");
set_button_icon(nullptr); set_button_icon(Ref<Texture2D>());
} else { } else {
ERR_FAIL_INDEX(p_which, popup->get_item_count()); ERR_FAIL_INDEX(p_which, popup->get_item_count());