Merge pull request #5794 from TheHX/editor-settings-dialog
Keep selected section in Editor Settings when reopening the dialog
This commit is contained in:
commit
c83aa5f863
@ -4232,19 +4232,32 @@ String SectionedPropertyEditor::get_full_item_path(const String& p_item) {
|
|||||||
|
|
||||||
void SectionedPropertyEditor::edit(Object* p_object) {
|
void SectionedPropertyEditor::edit(Object* p_object) {
|
||||||
|
|
||||||
if (p_object) {
|
if (!p_object) {
|
||||||
obj=p_object->get_instance_ID();
|
obj = -1;
|
||||||
update_category_list();
|
|
||||||
} else {
|
|
||||||
sections->clear();
|
sections->clear();
|
||||||
|
|
||||||
|
filter->set_edited(NULL);
|
||||||
|
editor->edit(NULL);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
filter->set_edited(p_object);
|
ObjectID id = p_object->get_instance_ID();
|
||||||
editor->edit(filter);
|
|
||||||
|
|
||||||
sections->select(0);
|
if (obj != id) {
|
||||||
_section_selected(0);
|
|
||||||
|
|
||||||
|
obj = id;
|
||||||
|
update_category_list();
|
||||||
|
|
||||||
|
filter->set_edited(p_object);
|
||||||
|
editor->edit(filter);
|
||||||
|
|
||||||
|
sections->select(0);
|
||||||
|
_section_selected(0);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
update_category_list();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SectionedPropertyEditor::update_category_list() {
|
void SectionedPropertyEditor::update_category_list() {
|
||||||
@ -4300,6 +4313,8 @@ PropertyEditor *SectionedPropertyEditor::get_property_editor() {
|
|||||||
|
|
||||||
SectionedPropertyEditor::SectionedPropertyEditor() {
|
SectionedPropertyEditor::SectionedPropertyEditor() {
|
||||||
|
|
||||||
|
obj = -1;
|
||||||
|
|
||||||
VBoxContainer *left_vb = memnew( VBoxContainer);
|
VBoxContainer *left_vb = memnew( VBoxContainer);
|
||||||
left_vb->set_custom_minimum_size(Size2(160,0)*EDSCALE);
|
left_vb->set_custom_minimum_size(Size2(160,0)*EDSCALE);
|
||||||
add_child(left_vb);
|
add_child(left_vb);
|
||||||
|
Loading…
Reference in New Issue
Block a user