diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 8a07b25245a..536b281bccb 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -182,14 +182,6 @@ Selects the file, with the path provided by [code]file[/code], in the FileSystem dock. - - - - - - - - @@ -210,6 +202,10 @@ + + + + diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 17baa4410b5..86c68a70714 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4945,7 +4945,7 @@ void EditorNode::set_distraction_free_mode(bool p_enter) { } } -bool EditorNode::get_distraction_free_mode() const { +bool EditorNode::is_distraction_free_mode_enabled() const { return distraction_free->is_pressed(); } diff --git a/editor/editor_node.h b/editor/editor_node.h index 0c547858a55..b2458ee5e7c 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -691,7 +691,7 @@ public: bool get_docks_visible() const; void set_distraction_free_mode(bool p_enter); - bool get_distraction_free_mode() const; + bool is_distraction_free_mode_enabled() const; void add_control_to_dock(DockSlot p_slot, Control *p_control); void remove_control_from_dock(Control *p_control); diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index a250e9cbee4..39aa26f26a9 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -281,6 +281,10 @@ void EditorInterface::set_distraction_free_mode(bool p_enter) { EditorInterface *EditorInterface::singleton = NULL; +bool EditorInterface::is_distraction_free_mode_enabled() const { + return EditorNode::get_singleton()->is_distraction_free_mode_enabled(); +} + void EditorInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("inspect_object", "object", "for_property"), &EditorInterface::inspect_object, DEFVAL(String())); @@ -312,6 +316,9 @@ void EditorInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("set_main_screen_editor", "name"), &EditorInterface::set_main_screen_editor); ClassDB::bind_method(D_METHOD("set_distraction_free_mode", "enter"), &EditorInterface::set_distraction_free_mode); + ClassDB::bind_method(D_METHOD("is_distraction_free_mode_enabled"), &EditorInterface::is_distraction_free_mode_enabled); + + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "distraction_free_mode"), "set_distraction_free_mode", "is_distraction_free_mode_enabled"); } EditorInterface::EditorInterface() { diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index a18f2de82ce..7002ee8b71d 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -105,6 +105,7 @@ public: void set_main_screen_editor(const String &p_name); void set_distraction_free_mode(bool p_enter); + bool is_distraction_free_mode_enabled() const; EditorInterface(); };