Skip to content

Commit 21e553c

Browse files
committed
Merge pull request godotengine#77096 from spanzeri/skeleton-editor-cleanup-followup
Additional cleanup of bone editors
2 parents 19df2e0 + b68cc30 commit 21e553c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

editor/plugins/skeleton_3d_editor_plugin.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@
5252
#include "scene/scene_string_names.h"
5353

5454
void BoneTransformEditor::create_editors() {
55-
const Color section_color = get_theme_color(SNAME("prop_subsection"), SNAME("Editor"));
56-
5755
section = memnew(EditorInspectorSection);
58-
section->setup("trf_properties", label, this, section_color, true);
56+
section->setup("trf_properties", label, this, Color(0.0f, 0.0f, 0.0f), true);
5957
section->unfold();
6058
add_child(section);
6159

@@ -94,7 +92,7 @@ void BoneTransformEditor::create_editors() {
9492

9593
// Transform/Matrix section.
9694
rest_section = memnew(EditorInspectorSection);
97-
rest_section->setup("trf_properties_transform", "Rest", this, section_color, true);
95+
rest_section->setup("trf_properties_transform", "Rest", this, Color(0.0f, 0.0f, 0.0f), true);
9896
section->get_vbox()->add_child(rest_section);
9997

10098
// Transform/Matrix property.
@@ -107,8 +105,10 @@ void BoneTransformEditor::create_editors() {
107105

108106
void BoneTransformEditor::_notification(int p_what) {
109107
switch (p_what) {
110-
case NOTIFICATION_ENTER_TREE: {
111-
create_editors();
108+
case NOTIFICATION_THEME_CHANGED: {
109+
const Color section_color = get_theme_color(SNAME("prop_subsection"), SNAME("Editor"));
110+
section->set_bg_color(section_color);
111+
rest_section->set_bg_color(section_color);
112112
} break;
113113
}
114114
}
@@ -128,6 +128,7 @@ void BoneTransformEditor::_value_changed(const String &p_property, Variant p_val
128128

129129
BoneTransformEditor::BoneTransformEditor(Skeleton3D *p_skeleton) :
130130
skeleton(p_skeleton) {
131+
create_editors();
131132
}
132133

133134
void BoneTransformEditor::set_keyable(const bool p_keyable) {

0 commit comments

Comments
 (0)