Unverified Commit 243cb503 by Rémi Verschelde Committed by GitHub

Merge pull request #39204 from Calinou/distraction-free-property-getter

Add a getter and property for the editor distraction-free mode
parents 19dc5c42 cc1859ef
...@@ -4782,7 +4782,7 @@ void EditorNode::set_distraction_free_mode(bool p_enter) { ...@@ -4782,7 +4782,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(); return distraction_free->is_pressed();
} }
......
...@@ -693,7 +693,7 @@ public: ...@@ -693,7 +693,7 @@ public:
bool get_docks_visible() const; bool get_docks_visible() const;
void set_distraction_free_mode(bool p_enter); 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 add_control_to_dock(DockSlot p_slot, Control *p_control);
void remove_control_from_dock(Control *p_control); void remove_control_from_dock(Control *p_control);
......
...@@ -270,6 +270,10 @@ void EditorInterface::set_distraction_free_mode(bool p_enter) { ...@@ -270,6 +270,10 @@ void EditorInterface::set_distraction_free_mode(bool p_enter) {
EditorNode::get_singleton()->set_distraction_free_mode(p_enter); EditorNode::get_singleton()->set_distraction_free_mode(p_enter);
} }
bool EditorInterface::is_distraction_free_mode_enabled() const {
return EditorNode::get_singleton()->is_distraction_free_mode_enabled();
}
EditorInterface *EditorInterface::singleton = nullptr; EditorInterface *EditorInterface::singleton = nullptr;
void EditorInterface::_bind_methods() { void EditorInterface::_bind_methods() {
...@@ -302,6 +306,9 @@ void EditorInterface::_bind_methods() { ...@@ -302,6 +306,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_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("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() { EditorInterface::EditorInterface() {
......
...@@ -105,6 +105,7 @@ public: ...@@ -105,6 +105,7 @@ public:
void set_main_screen_editor(const String &p_name); void set_main_screen_editor(const String &p_name);
void set_distraction_free_mode(bool p_enter); void set_distraction_free_mode(bool p_enter);
bool is_distraction_free_mode_enabled() const;
EditorInterface(); EditorInterface();
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment