Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional cleanup of bone editors #77096

Merged
Merged
Changes from all commits
Commits
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
13 changes: 7 additions & 6 deletions editor/plugins/skeleton_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@
#include "scene/scene_string_names.h"

void BoneTransformEditor::create_editors() {
const Color section_color = get_theme_color(SNAME("prop_subsection"), SNAME("Editor"));

section = memnew(EditorInspectorSection);
section->setup("trf_properties", label, this, section_color, true);
section->setup("trf_properties", label, this, Color(0.0f, 0.0f, 0.0f), true);
section->unfold();
add_child(section);

Expand Down Expand Up @@ -93,7 +91,7 @@ void BoneTransformEditor::create_editors() {

// Transform/Matrix section.
rest_section = memnew(EditorInspectorSection);
rest_section->setup("trf_properties_transform", "Rest", this, section_color, true);
rest_section->setup("trf_properties_transform", "Rest", this, Color(0.0f, 0.0f, 0.0f), true);
section->get_vbox()->add_child(rest_section);

// Transform/Matrix property.
Expand All @@ -106,8 +104,10 @@ void BoneTransformEditor::create_editors() {

void BoneTransformEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
create_editors();
case NOTIFICATION_THEME_CHANGED: {
const Color section_color = get_theme_color(SNAME("prop_subsection"), SNAME("Editor"));
section->set_bg_color(section_color);
rest_section->set_bg_color(section_color);
} break;
}
}
Expand All @@ -127,6 +127,7 @@ void BoneTransformEditor::_value_changed(const String &p_property, Variant p_val

BoneTransformEditor::BoneTransformEditor(Skeleton3D *p_skeleton) :
skeleton(p_skeleton) {
create_editors();
}

void BoneTransformEditor::set_keyable(const bool p_keyable) {
Expand Down