Browse Source

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

Fix OptionButton not removing icon when using clear
Thaddeus Crews 1 month ago
parent
commit
86bb48ab83
1 changed files with 2 additions and 1 deletions
  1. 2 1
      scene/gui/option_button.cpp

+ 2 - 1
scene/gui/option_button.cpp

@@ -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());