Fix OptionButton not removing icon when using clear

This commit is contained in:
Giganzo
2025-08-18 23:41:19 +02:00
parent 0c51ede243
commit 5c59a75923

View File

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