Fix label update for dict on item deletion.

This commit is contained in:
ajreckof 2024-08-10 19:33:59 +02:00
parent 3978628c6c
commit 6577a39bd0
1 changed files with 6 additions and 0 deletions

View File

@ -907,6 +907,8 @@ void EditorPropertyDictionary::_add_key_value() {
VariantInternal::initialize(&new_value, type); VariantInternal::initialize(&new_value, type);
object->set_new_item_value(new_value); object->set_new_item_value(new_value);
object->set_dict(dict);
slots[(dict.size() - 1) % page_length].update_prop_or_index();
emit_changed(get_edited_property(), dict); emit_changed(get_edited_property(), dict);
} }
@ -960,6 +962,10 @@ void EditorPropertyDictionary::_change_type_menu(int p_index) {
dict[key] = value; dict[key] = value;
} else { } else {
dict.erase(key); dict.erase(key);
object->set_dict(dict);
for (Slot &slot : slots) {
slot.update_prop_or_index();
}
} }
emit_changed(get_edited_property(), dict); emit_changed(get_edited_property(), dict);