From 2ac89f65403c606ad9a3cdf65e591cb375faf024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 25 Jan 2017 02:46:44 +0100 Subject: [PATCH] Include filesystem dock split offset in editor layouts --- tools/editor/editor_node.cpp | 8 ++++++++ tools/editor/filesystem_dock.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 320d80a96c3..6662afb391d 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4492,6 +4492,8 @@ void EditorNode::_save_docks_to_config(Ref p_layout, const String& p } } + p_layout->set_value(p_section,"dock_filesystem_split",filesystem_dock->get_split_offset()); + VSplitContainer*splits[DOCK_SLOT_MAX/2]={ left_l_vsplit, left_r_vsplit, @@ -4665,6 +4667,12 @@ void EditorNode::_load_docks_from_config(Ref p_layout, const String& } } + int fs_split_ofs = 0; + if (p_layout->has_section_key(p_section,"dock_filesystem_split")) { + fs_split_ofs = p_layout->get_value(p_section,"dock_filesystem_split"); + } + filesystem_dock->set_split_offset(fs_split_ofs); + VSplitContainer*splits[DOCK_SLOT_MAX/2]={ left_l_vsplit, left_r_vsplit, diff --git a/tools/editor/filesystem_dock.h b/tools/editor/filesystem_dock.h index 506a4107e94..953e7c7d466 100644 --- a/tools/editor/filesystem_dock.h +++ b/tools/editor/filesystem_dock.h @@ -191,6 +191,9 @@ public: void set_display_mode(int p_mode); + int get_split_offset() { return split_box->get_split_offset(); } + void set_split_offset(int p_offset) { split_box->set_split_offset(p_offset); } + FileSystemDock(EditorNode *p_editor); ~FileSystemDock(); };