Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
f5b0885
Removed unused function declaration from header file
FeatherAntennae Aug 30, 2019
5cb04b2
Added icons for folded and unfolded lists
FeatherAntennae Aug 30, 2019
6930a2c
Added menu button to editor settings' dialogue
FeatherAntennae Aug 30, 2019
af34c6f
Added menu button to editor settings' dialogue
FeatherAntennae Aug 30, 2019
02eff60
Added menu button to editor settings' dialogue
FeatherAntennae Aug 30, 2019
56c16ae
Merge remote-tracking branch 'Upstream/master' into origin/editor-set…
FeatherAntennae Oct 12, 2019
2058744
Removed duplicated icons to use existing ones in the setting config d…
FeatherAntennae Oct 12, 2019
800eda9
Select manually collapsed TreeItem to improve "collapse unselected" b…
FeatherAntennae Oct 12, 2019
e7de1e5
Added confirmation dialogs to "restore all" choices.
FeatherAntennae Oct 12, 2019
11ca92c
Implemented restore all default shortcuts.
FeatherAntennae Oct 12, 2019
274de25
Implemented restore all default settings
FeatherAntennae Oct 13, 2019
7efcf1c
Implemented collapse/expand all and collapse unselected for editor se…
FeatherAntennae Oct 13, 2019
020c5fe
Moved popup declaration to header file
FeatherAntennae Oct 14, 2019
b0c19dd
Small refactor of the code and cleanup.
FeatherAntennae Nov 11, 2019
ad154ff
Allowed public access to the sections tree of EditorSectionedInspector
FeatherAntennae Nov 12, 2019
5e99abd
Added context menu to shortcuts and sections of the setting config di…
FeatherAntennae Nov 12, 2019
752c0a4
Merge remote-tracking branch 'refs/remotes/Upstream/master' into edit…
FeatherAntennae Nov 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions editor/editor_sectioned_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ void SectionedInspector::_bind_methods() {
ClassDB::bind_method("_section_selected", &SectionedInspector::_section_selected);
ClassDB::bind_method("_search_changed", &SectionedInspector::_search_changed);

ClassDB::bind_method("get_sections", &SectionedInspector::get_sections);
ClassDB::bind_method("collapse_all_sections", &SectionedInspector::collapse_all_sections);
ClassDB::bind_method("expand_all_sections", &SectionedInspector::expand_all_sections);
ClassDB::bind_method("collapse_unselected", &SectionedInspector::collapse_unselected);
ClassDB::bind_method("update_category_list", &SectionedInspector::update_category_list);
}

Expand Down Expand Up @@ -164,6 +168,11 @@ String SectionedInspector::get_current_section() const {
return "";
}

Tree *SectionedInspector::get_sections() const {

return sections;
}

String SectionedInspector::get_full_item_path(const String &p_item) {

String base = get_current_section();
Expand Down Expand Up @@ -307,6 +316,37 @@ EditorInspector *SectionedInspector::get_inspector() {
return inspector;
}

void SectionedInspector::collapse_all_sections() {

if (sections->get_root() && sections->get_root()->get_children()) {
for (TreeItem *section = sections->get_root()->get_children(); section; section = section->get_next()) {
section->set_collapsed(true);
}
}
}

void SectionedInspector::expand_all_sections() {

if (sections->get_root() && sections->get_root()->get_children()) {
for (TreeItem *section = sections->get_root()->get_children(); section; section = section->get_next()) {
section->set_collapsed(false);
}
}
}

void SectionedInspector::collapse_unselected() {

if (sections->get_root() && sections->get_root()->get_children()) {
for (TreeItem *section = sections->get_root()->get_children(); section; section = section->get_next()) {

String sectionName = section->get_metadata(0);
if (!get_current_section().begins_with(sectionName)) {
section->set_collapsed(true);
}
}
}
}

SectionedInspector::SectionedInspector() :
obj(-1),
sections(memnew(Tree)),
Expand Down
5 changes: 5 additions & 0 deletions editor/editor_sectioned_inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ class SectionedInspector : public HSplitContainer {

void update_category_list();

Tree *get_sections() const;
void collapse_all_sections();
void expand_all_sections();
void collapse_unselected();

SectionedInspector();
~SectionedInspector();
};
Expand Down
Loading