diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-14 23:09:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 23:09:03 +0200 |
commit | 00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (patch) | |
tree | 2b1c31f45add24085b64425ce440f577424c16a1 /editor/plugins/style_box_editor_plugin.cpp | |
parent | 5046f666a1181675b39f156c38346525dc1c444e (diff) | |
parent | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (diff) |
Merge pull request #38738 from akien-mga/cause-we-never-go-out-of-style
Style: Remove new line at block start, enforce line between functions, enforce braces in if and loop blocks
Diffstat (limited to 'editor/plugins/style_box_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/style_box_editor_plugin.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/editor/plugins/style_box_editor_plugin.cpp b/editor/plugins/style_box_editor_plugin.cpp index eb6e261305..3641052a4e 100644 --- a/editor/plugins/style_box_editor_plugin.cpp +++ b/editor/plugins/style_box_editor_plugin.cpp @@ -33,28 +33,28 @@ #include "editor/editor_scale.h" bool EditorInspectorPluginStyleBox::can_handle(Object *p_object) { - return Object::cast_to<StyleBox>(p_object) != nullptr; } void EditorInspectorPluginStyleBox::parse_begin(Object *p_object) { - Ref<StyleBox> sb = Ref<StyleBox>(Object::cast_to<StyleBox>(p_object)); StyleBoxPreview *preview = memnew(StyleBoxPreview); preview->edit(sb); add_custom_control(preview); } + bool EditorInspectorPluginStyleBox::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) { return false; //do not want } + void EditorInspectorPluginStyleBox::parse_end() { } void StyleBoxPreview::edit(const Ref<StyleBox> &p_stylebox) { - - if (stylebox.is_valid()) + if (stylebox.is_valid()) { stylebox->disconnect("changed", callable_mp(this, &StyleBoxPreview::_sb_changed)); + } stylebox = p_stylebox; if (p_stylebox.is_valid()) { preview->add_theme_style_override("panel", stylebox); @@ -64,7 +64,6 @@ void StyleBoxPreview::edit(const Ref<StyleBox> &p_stylebox) { } void StyleBoxPreview::_sb_changed() { - preview->update(); } @@ -93,7 +92,6 @@ StyleBoxPreview::StyleBoxPreview() { } StyleBoxEditorPlugin::StyleBoxEditorPlugin(EditorNode *p_node) { - Ref<EditorInspectorPluginStyleBox> inspector_plugin; inspector_plugin.instance(); add_inspector_plugin(inspector_plugin); |