Merge pull request #53263 from Calinou/editor-inspector-warning-yellow-3.x

This commit is contained in:
Rémi Verschelde 2021-10-05 11:12:44 +02:00 committed by GitHub
commit 59930dca00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -66,7 +66,7 @@
Used by the inspector, set to [code]true[/code] when the property is checked.
</member>
<member name="draw_red" type="bool" setter="set_draw_red" getter="is_draw_red" default="false">
Used by the inspector, set to [code]true[/code] when the property must draw with error color. This is used for editable children's properties.
Used by the inspector, set to [code]true[/code] when the property is drawn with the editor theme's warning color. This is used for editable children's properties.
</member>
<member name="keying" type="bool" setter="set_keying" getter="is_keying" default="false">
Used by the inspector, set to [code]true[/code] when the property can add keys for animation.

View file

@ -209,7 +209,7 @@ void EditorProperty::_notification(int p_what) {
Color color;
if (draw_red) {
color = get_color("error_color");
color = get_color("warning_color");
} else {
color = get_color("property_color");
}

View file

@ -769,7 +769,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("bg_selected", "EditorProperty", style_property_bg);
theme->set_stylebox("bg", "EditorProperty", Ref<StyleBoxEmpty>(memnew(StyleBoxEmpty)));
theme->set_constant("vseparation", "EditorProperty", (extra_spacing + default_margin_size) * EDSCALE);
theme->set_color("error_color", "EditorProperty", error_color);
theme->set_color("warning_color", "EditorProperty", warning_color);
theme->set_color("property_color", "EditorProperty", property_color);
theme->set_constant("inspector_margin", "Editor", 8 * EDSCALE);